python-json-pointer icon indicating copy to clipboard operation
python-json-pointer copied to clipboard

Relative JSON Pointers

Open Julian opened this issue 7 years ago • 3 comments

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

Julian avatar Jan 05 '19 11:01 Julian

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.

st31ny avatar May 22 '19 17:05 st31ny

@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.

handrews avatar May 22 '19 19:05 handrews

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).

st31ny avatar May 23 '19 14:05 st31ny