wanglingsong / JsonSurfer

A streaming JsonPath processor in Java
MIT License
292 stars 55 forks source link

JsonPath/SQL standard #72

Open viliam-durina opened 2 years ago

viliam-durina commented 2 years ago

The JsonPath language isn't standardized. When SQL accommodated it, they actually formally specified the language, however in a different flavor. Example differences:

I'm not deeply familiar with the SQL's nuances, there might be a couple more differences. We're implementing JsonPath support in an SQL engine. My question is have you ever considered supporting the SQL flavor? Would you accept PRs adding support for them, provided that the old syntax is unaffected and the SQL way will be an alternative syntax? So far this seems possible. Or to provide a configuration setting to pick the flavor?

wanglingsong commented 2 years ago

You're right. There is no standard JsonPath so far. And you can find comparison for most JsonPath implementation here: https://github.com/cburgmer/json-path-comparison I'm not sure whether most of JsonSurfer users need SQL flavor syntax. I could add it as an option, if there were enough vote for it. For now I would suggest you make a fork first to implement different JsonPathCompiler for the SQL syntax