stefankoegl / python-json-pointer

Resolve JSON Pointers in Python
https://python-json-pointer.readthedocs.org/
Other
139 stars 43 forks source link

Relative JSON Pointers #34

Open Julian opened 5 years ago

Julian commented 5 years ago

Hi!

Was wondering what you think about @handrews' Relative JSON Pointer specification.

Do you feel it has a place within this library, or would you rather it be separate?

(I ask of course because as in #20, I'm about to add support for validating relative JSON pointers to jsonschema).

Cheers, -J

st31ny commented 5 years ago

As far as I can see from the specs, relative JSON pointers and ordinary JSON pointers can clearly be distinguished based on their first character, so an extension to this library should be possible.

handrews commented 5 years ago

@steinymity yes the intention of the original author (I just took it over to update it- it will get a new draft shortly which fixes a typo or two but nothing major) was that they were never ambiguous.

st31ny commented 5 years ago

Well, so the only big hassle I see here is that relative JSON pointers need to be able to go to a parent object/array, but this "feature" is not available on standard dicts.

Maybe it makes sense to split the JSON pointer implementation in a data structure agnostic part (which just does parsing and validation) and an extendible part for a particular data structure, similar to pathlib's PurePath vs Path (and their subclasses).