JSON Path is getting an IETF spec!
It looks like the spec draft that you've based your implementation on is old. Check out the details at https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base. There have been quite a few changes (with good reason) since you last looked.
Mainly:
-
inand=~are no longer valid operators. - functions in expressions
Also, I would recommend hiding JsonPath-Plus features behind a default-off configuration option to align with the spec.
There's also a comparison website which lists a bunch of paths and various implementations' results. I've added an issue to add this lib. I'll be working on it (I am not a JS dev), but if you want to add it yourself, feel free. It'd be great to have another implementation there.
And if you want to join in the coversation for developing the spec, you'd be welcome!
JSON Path now has an RFC!
https://www.rfc-editor.org/rfc/rfc9535.html
Hey!
Yup, I'm following the progress.
I have an almost spec-compliant parser ready and will need to adjust the codegen later on.
I don't know the timeline yet, but I'd really like to complete that work some time this year, hopefully before the spec is final.
At this point, I'm still not fully confident I'll add support for functions that take NodesType, but let's see. The parser itself will follow the official grammar.
I'll certainly hide JSONPath-plus additions behind the flag as I'm not a huge fan of them. The only reason I added them in the first place was because of https://github.com/stoplightio/spectral.
Yeah, I understand having a large client like that can drive features. Let's hope they get on board.
We're also putting together a test suite. I don't think it can be "official," but the people who worked on the spec are building it, so that's close enough.
I'm working on it right now and have the vast majority of the spec implemented. However, I will most likely introduce a new library as there's no reasonable way to make the new spec work while retaining backward compatibility. The test suite was pretty useful!
Can you just release a major version bump of this lib? This lib has a fair number of significant users, and the idea is to pull them along.
The new package is here https://github.com/P0lip/jsonpath-rfc9535 and folks looking for a compliant implementation can use it.
Can you just release a major version bump of this lib?
I might do it, but nimma would never be fully compliant anyway due to how it works.
Moreover, filter-query is arguably difficult to optimize in its current form, and it would require an overhaul of Nimma to make it work nicely.
I guess now, you need to push Spectral Too use the new lib. They'll need to know that it will break people. The RFC paths are not entirely backwards compatible with all the added features that variation libs added.