-
Notifications
You must be signed in to change notification settings - Fork 584
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
URI and URI-reference are overlapping types #511
Comments
The second ref should obviously be URI, it’s a typo. I believe we picked absolute URI for this one case because relative made no sense for something that is supposed to uniquely identify something in a global sense.
Thanks,
-Doug
Sent from my iPhone
… On Sep 20, 2019, at 12:21 AM, Alan Conway ***@***.***> wrote:
This came up while implementing a Go mapping for the cloudevents type system. Here's the definition of URI and URI-reference:
URI - Absolute uniform resource identifier.
String encoding: Absolute URI as defined in RFC 3986 Section 4.3.
URI-reference - Uniform resource identifier reference.
String encoding: URI-reference as defined in RFC 3986 Section 4.1.
The issue is that all legal values of the URI type are also legal values of the URI-reference type. It is unusual to have a separate type to distinguish absolute URIs from relative-or-absolute URIs. In Go, python and ruby there is a single type (named URI or URL), and it has a test such as u.IsAbs() to distinguish absolute from relative values.
The URI type is only used in one place and there the language is ambiguous:
dataschema
Type: URI
Description: Identifies the schema that data adheres to. Incompatible changes to the schema SHOULD be reflected by a different URI. See Versioning of Attributes in the Primer for more information.
Constraints:
OPTIONAL
If present, MUST be a non-empty URI-reference
Note the conflicting claims that this attribute is of type URI but MUST be a URI-reference (which may be an invalid URI!) Can we drop the URI type and use URI-reference everywhere instead?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I think we used to use relative URI everywhere and just missed that one when we switched to URI
Thanks,
-Doug
Sent from my iPhone
… On Sep 20, 2019, at 12:21 AM, Alan Conway ***@***.***> wrote:
This came up while implementing a Go mapping for the cloudevents type system. Here's the definition of URI and URI-reference:
URI - Absolute uniform resource identifier.
String encoding: Absolute URI as defined in RFC 3986 Section 4.3.
URI-reference - Uniform resource identifier reference.
String encoding: URI-reference as defined in RFC 3986 Section 4.1.
The issue is that all legal values of the URI type are also legal values of the URI-reference type. It is unusual to have a separate type to distinguish absolute URIs from relative-or-absolute URIs. In Go, python and ruby there is a single type (named URI or URL), and it has a test such as u.IsAbs() to distinguish absolute from relative values.
The URI type is only used in one place and there the language is ambiguous:
dataschema
Type: URI
Description: Identifies the schema that data adheres to. Incompatible changes to the schema SHOULD be reflected by a different URI. See Versioning of Attributes in the Primer for more information.
Constraints:
OPTIONAL
If present, MUST be a non-empty URI-reference
Note the conflicting claims that this attribute is of type URI but MUST be a URI-reference (which may be an invalid URI!) Can we drop the URI type and use URI-reference everywhere instead?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
For reference, this is the PR that changed it to URI: #475 (comment) I think it was during a weekly call that someone raised a concern about it being a URI-reference. |
- s/0.4-wip/1.0-rc1/ - s/URI-reference/URI/ in scheme section for spec.md - per issue cloudevents#511 since it was just a typo - updated Roadmap to say we completed 1.0-rc1 milestone Signed-off-by: Doug Davis <dug@us.ibm.com>
@alanconway I fixed the URI-ref -> URI typo as part of #512 |
I guess I'll drop this since we allow type-morphing to canonical string and URI < URI-reference < String. I think most programming language mappings and bindings will end up mapping URI and URI-reference to the same native type but that's OK. |
This came up while implementing a Go mapping for the cloudevents type system. Here's the definition of URI and URI-reference:
URI - Absolute uniform resource identifier.
String encoding: Absolute URI as defined in RFC 3986 Section 4.3.
URI-reference - Uniform resource identifier reference.
String encoding: URI-reference as defined in RFC 3986 Section 4.1.
The issue is that all legal values of the URI type are also legal values of the URI-reference type. It is unusual to have a separate type to distinguish absolute URIs from relative-or-absolute URIs. In Go, python and ruby there is a single type (named URI or URL), and it has a test such as u.IsAbs() to distinguish absolute from relative values.
The URI type is only used in one place and there the language is ambiguous:
dataschema
Type: URI
Description: Identifies the schema that data adheres to. Incompatible changes to the schema SHOULD be reflected by a different URI. See Versioning of Attributes in the Primer for more information.
Constraints:
OPTIONAL
If present, MUST be a non-empty URI-reference
Note the conflicting claims that this attribute is of type URI but MUST be a URI-reference (which may be an invalid URI!) Can we drop the URI type and use URI-reference everywhere instead?
The text was updated successfully, but these errors were encountered: