jmespath / jmespath.py

JMESPath is a query language for JSON.
http://jmespath.org
MIT License
2.19k stars 181 forks source link

Adding a proposal for functions #25

Closed mtdowling closed 10 years ago

mtdowling commented 10 years ago

This PR adds a functions proposal including the new syntax, built-in functions, and test cases.

jeremeamia commented 10 years ago

That looks awesome!

mtdowling commented 10 years ago

I updated the grammar to make function-expression an expression, added a note that String related functions expect Unicode, and moved defining what "truthy" and "falsey" means to its own section.

length() has now been updated to handle Strings, Objects, and Arrays (instead of a count() and length() method).

mtdowling commented 10 years ago

I've updated the JEP to add a new syntax for JavaScript literals, lowercased types, removed nulls from function return type signatures, removed truthy/falsey stuff in favor of pushing this to another JEP, and removed the get() function in favor of changing the or-expression.

I'm researching your questions about unicode.

mtdowling commented 10 years ago

I've updated the JEP to use backticks for JSON literals rather than underscores. This allows for a much richer use of JSON literals, including arrays and objects.