-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
[question] Is relative-path URI allowed with the "uri" format? #310
Comments
@erayd RFC 3986 makes a clear distinction between "URI" and "URI reference". Section 4.2 is defining URI references. While the distinction may not jump out on first read, if you go through knowing this you'll see that it's quite clear. In the draft-06 meta-schema (for the newly published draft-wright-json-schema-validation-01) you want to use |
@handrews The format is "uri-reference" |
@handrews Thanks - I appreciate the clarification; I thought that 'URI Reference' was a kind of URI, rather than something else entirely - it seems that I missed the paragraph which specifies this, but after reading through the RFC again I can see it's definitely there! What's the story with this for draft-03 and draft-04? I can't help but feel that I'm missing something critical here - those versions of the spec both lack a dedicated format for URI reference, and have a testsuite / meta-schema which looks technically invalid (because of values in RFC-3986 Section 4 says this:
Is the intention that older drafts do not allow references, but do allow incomplete URI syntax (in which case, where do I find this definition), or are older drafts intended to allow references as part of the |
@erayd the group working on the JSON Schema specifications now is the (I think) third group to take on the project (hence the three year gap after draft-04 when the second group dropped it). So we usually don't know the reasoning behind the older drafts unless it was clearly documented somewhere. I definitely do not know this particular story, maybe @awwright or @Julian might have some insight? |
For draft 4 this pulls in upstream fixes which were not present locally, notably fixing `id` to not have `format: uri` in it, because location independent identifiers are indeed not URIs (they're URI references as later metaschemas use). For enum, on draft 3 and 4, this also *re-adds* constraints that enum items MUST be unique and the array non-empty. In later drafts, this restriction was loosened (see json-schema-org/json-schema-spec@cf0ec72) as well as json-schema-org/json-schema-spec#717 (comment) but in drafts 3 and 4 it is present. The draft 4 metaschema contains these assertions, the draft 3 one is still buggy and does not, so they're just applied locally here. Ref: json-schema-org/json-schema-spec#310
RFC-3986 section 4.2 seems to indicate that this is acceptable, and the spec says that RFC-3986 is the format used, however the testsuite considers relative-path URI to be invalid, and based on the description seems to be doing so deliberately.
Is this intended to be a deliberate deviation from RFC-3986, or is the testsuite wrong, or am I misunderstanding something?
The text was updated successfully, but these errors were encountered: