-
-
Notifications
You must be signed in to change notification settings - Fork 312
Format json-pointer: uri fragment, json pointer or both #328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
My intention with that format was an actual JSON Pointer ("/some/property"), and not a fragment that happens to be a JSON Pointer ("#/some/property"). The fragment would be format uri-reference. Since RFC 6901 describes the fragment encoding as well, I can see how this would be confusing. |
@handrews |
@epoberezkin I don't see any need for formats for specific fragment-only URI reference syntaxes. Or any other subset of {
"type": "string",
"format": "uri-reference",
"pattern": "^#"
} Since fragments are interpreted based on the media type of the resourced being referenced, whether or not that fragment can be (or must be) a JSON Pointer is determined by the media type. In the case where a media type (such as {
"type": "string",
"format": "uri-reference",
"pattern": "^#/"
} (note the extra forward slash in the pattern) |
Thx for your replies. Do you think it's worth to put a little note to 8.3.9. stating that the fragment representation is excluded? OR RFC6901 doesn't use the term "valid Json Pointer". Maybe use "JSON String representation" instead (be close to RFC6901 as possible)? Are new tests needed to check that (I can write some)? As I can see there are some tests for the json-pointer format. Best regards |
He would! |
Hi all, tests are written. @handrews I'm not very good at writing a specification, therefore I'll leave this matter to another one. Best wishes, I hope you will get better soon. Thank you all. :) Edit: Please see also the discussion in json-schema-org/JSON-Schema-Test-Suite#186 |
Further evidence that this requires clarification in the standard (and probably more on the web site, but at least a line about it in the spec seems necessary). https://groups.google.com/d/msg/json-schema/gP6T8dEVJFQ/Ek3yhbAlBAAJ |
Addresses issue json-schema-org#328. URI fragment-encoded JSON Pointers are already handled by the "uri-reference" format, plus "pattern" if the media type supports multiple fragment types that would need to be disambiguated. Guidance on using "uri-reference" plus "pattern" belongs on the web site, so I did not add it to the spec.
Fixed in #354. |
Hi there,
first: great work with draft-06. I really like it and I'm about to update my schemes for it. Looks really good so far.
But one thing is unclear to me:
This means the "json pointer" representation or the uri fragment one, or both? Some validators like ajv (@epoberezkin) allow both versions, but the term "valid JSON pointer" may suggest otherwise. I guess most people will expect both representations to work, but as it is written above it may not be intended (strictly speaking)?
Implementationwise it should be a difference, because an uri fragment may contain percent-encoded characters, while the other one doesn't.
Best regards
The text was updated successfully, but these errors were encountered: