Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Correct some uses of 'URI' to 'URI reference' in structuring #105

Merged
merged 1 commit into from
Nov 28, 2019

Conversation

AdamWill
Copy link
Contributor

@AdamWill AdamWill commented Aug 9, 2019

While dealing with an issue in a set of schemas:
https://pagure.io/fedora-ci/messages/issue/67
I got rather confused by these docs until I went and read the
official spec drafts. In several places while discussing $id
and $ref, these docs claim these must be "URIs", but this is
not what the official draft says. It says they must be "URI-
references". From section 8.2, referring to $id:

"If present, the value for this keyword MUST be a string, and
MUST represent a valid URI-reference [RFC3986]."

From section 8.3, referring to $ref:

"The value of the "$ref" property MUST be a URI Reference."

This is a crucial and significant difference, as we can see in
RFC3986:

"A URI-reference is either a URI or a relative reference. If
the URI-reference's prefix does not match the syntax of a scheme
followed by its colon separator, then the URI-reference is a
relative reference."

That is, there is no such thing as a "relative URI" (since RFC
3986 came in, anyway, and clarified this as compared to earlier
RFCs). URIs are absolute by definition. If the doc says something
must be a 'URI' then the most obvious reading is that it must be
an absolute-URI as defined in RFC3986. If it can in fact be a
relative reference, we must make this clear.

Signed-off-by: Adam Williamson [email protected]

While dealing with an issue in a set of schemas:
https://pagure.io/fedora-ci/messages/issue/67
I got rather confused by these docs until I went and read the
official spec drafts. In several places while discussing `$id`
and `$ref`, these docs claim these must be "URIs", but this is
not what the official draft says. It says they must be "URI-
references". From section 8.2, referring to `$id`:

"If present, the value for this keyword MUST be a string, and
MUST represent a valid URI-reference [RFC3986]."

From section 8.3, referring to `$ref`:

"The value of the "$ref" property MUST be a URI Reference."

This is a crucial and significant difference, as we can see in
RFC3986:

"A URI-reference is either a URI or a relative reference.  If
the URI-reference's prefix does not match the syntax of a scheme
followed by its colon separator, then the URI-reference is a
relative reference."

That is, there is no such thing as a "relative URI" (since RFC
3986 came in, anyway, and clarified this as compared to earlier
RFCs). URIs are absolute by definition. If the doc says something
must be a 'URI' then the most obvious reading is that it must be
an absolute-URI as defined in RFC3986. If it can in fact be a
relative reference, we must make this clear.

Signed-off-by: Adam Williamson <[email protected]>
Copy link
Member

@awwright awwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this seems to be an improvement.

We don't use URI-reference with the hyphen too much, but it's not wrong and might even be better than a space.

@AdamWill
Copy link
Contributor Author

AdamWill commented Aug 9, 2019

I used that form as it's what the RFC uses in defining the term. The JSON Schema draft is, as the quotes I provided show, inconsistent on what form it uses. :P

@AdamWill
Copy link
Contributor Author

AdamWill commented Sep 6, 2019

Ping?

@AdamWill
Copy link
Contributor Author

ping again...

@Relequestual Relequestual merged commit ecb32a5 into json-schema-org:master Nov 28, 2019
@Relequestual
Copy link
Member

@AdamWill Sorry it's taken so long to approve and merge! Thanks for your contribution!

Feel free to highlight or fix any other issues. We're trying to focus on the test suite for 2019-09 currently, so expect a similar time frame to approve and merge.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants