-
-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add query support #54
Conversation
Hi @kulikala, Regards, |
This feature looks desirable, if we can test this feature thoroughly and make sure it does not introduce bug into old APIs. After all, the ease of use directly contributes to the popularity of an open source project. |
+1 |
Dear @kgabis, When you call Here are the pros and cons I can think of: pros
cons
|
Fix the argument name of the implementation so that it fits the declaration.
I'm still not convinced this should end up in the library. The only use case I can think of when array notation will be useful is when you know exactly how many elements an array has which I assume is not that common. It might be nice to have this functionality in dotget/dotset functions (although I like name query a lot more, but it's too late to change that) however I'd rather not add a whole new set of functions just for that. It might confuse library users because there will be 2 ways to accomplish a similar goal. The only downside of using dotget/dotset functions is that they must be called on objects so it won't be possible to call them on an array. I've made an issue (not really an issue though) for this feature at #57. |
Parson already has dotget and dotset functions which I admit are minimal and sufficient as API.
Even so, many of JSON will contain both objects and arrays, in a way it'll be easier to have the accessing syntax to traverse JSON handling both objects and arrays together just like JavaScript.