Skip to content
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

Tweak URI-references and be smart with Strings #478

Merged
merged 2 commits into from
Aug 16, 2019

Conversation

duglin
Copy link
Collaborator

@duglin duglin commented Aug 5, 2019

I can't think of a good reason why URI-references should be allowed to
be blank since that seems about as useful as the property not being
there at all.

Closes #473

Signed-off-by: Doug Davis dug@us.ibm.com

@duglin duglin added the v1.0 label Aug 5, 2019
@duglin
Copy link
Collaborator Author

duglin commented Aug 5, 2019

I think this help address some of #456 too

primer.md Outdated
Attributes of type URI-reference have quite a large set of valid values that
can be used. For example, it is possible that the `source` attribute could be
as short as `home` or could be more meaningful, such as
`com.example.my-component`. The CloudEvents specification allows for a wide
Copy link
Contributor

Choose a reason for hiding this comment

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

example.com/my-component sounds more like a proper URI-ref to me (unless my-component is a new TLD I haven't heard of yet 😉 )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed :-)

primer.md Outdated
interoperability while still being flexible enough to be used in unique
situations. So, CloudEvent producers are encouraged to only use values that
have the best chance of being properly processed by all possible formats
and transports that their CloudEvents might be used with.
Copy link
Contributor

Choose a reason for hiding this comment

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

For SaaS publishers, their CloudEvents may end up being used with any format or transport. It'd be good to know the minimum one can rely on. ASCII? URL encoding?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought about that too, but then I noticed that define Strings as Sequence of printable Unicode characters
which to me removed a fair about of the reasons for needing to URL encode stuff. Plus I didn't think we'd want to get into when, or when not, to encode Strings since then we'd need a mechanism by which consumers would have to know when they're encoded. That's when I decided "just don't be dumb" was good enough.

But if someone has any ideas...

primer.md Outdated
as short as `home` or could be more meaningful, such as
`http://home.example.com`. The CloudEvents specification allows for a wide
range of values to allow for it to be used in as any use cases as possible,
without undo burden on implementations.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/undo/undue

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

LOL fixed

I can't think of a good reason why URI-references should be allowed to
be blank since that seems about as useful as the property not being
there at all.

Signed-off-by: Doug Davis <dug@us.ibm.com>
primer.md Outdated
themselves based on their needs and expected usage of their events.

Additionally, the CloudEvents specification does not define a `baseURI`
to be used along with the URI-reference type attributes. This is because,
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder, if it prohibits that event producers would define a base URI in their documentation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we can stop anyone from doing so... but I'd question the need for it :-)

primer.md Outdated
unless otherwise stated, the URI-references are not meant to be normalized
or used for any other purpose other than comparing its string value against
some other URI-reference string value for equality. The use of URI-reference,
instead of just a String, was done to encourage the use of meaningful values
Copy link
Contributor

Choose a reason for hiding this comment

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

Referring to a complex specification such as RFC3986 just to encourage people to chose meaningful values while ignoring most of the specification, seems a bit strange.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

maybe but I think there is something to be said for encouraging some level of consistency, but still allowing a lot of freedom. Kind of like a best-practice. But, having said that, this is just my memory of our previous chats and if people think I'm remembering incorrectly, or they just don't want to even mention this aspect of it, I'd be ok with removing this sentence if that would help

@duglin
Copy link
Collaborator Author

duglin commented Aug 8, 2019

up updated based on today's call. Let me know what you think

@deissnerk
Copy link
Contributor

Thank you @duglin! LGTM

spec.md Show resolved Hide resolved
@duglin
Copy link
Collaborator Author

duglin commented Aug 15, 2019

moved the "RECOMMENDED" line into the constraints section and deleted the rest of the paragraph - per today's call.

Approved with the above change on the 8/15 call

Can I get an LGTM to make sure I didn't mess anything up before I merge?

Copy link
Contributor

@cneijenhuis cneijenhuis left a comment

Choose a reason for hiding this comment

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

LGTM overall.

spec.md Outdated
@@ -251,6 +251,8 @@ The following attributes are REQUIRED to be present in all CloudEvents:

- Constraints:
- REQUIRED
- MUST be a non-empty URI-reference
- RECOMMENDED that an absolute URI be used
Copy link
Contributor

Choose a reason for hiding this comment

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

Disclaimer: I'm not a native English speaker. be used sounds strange to me here.
Either try is used or maybe An absolute URI is RECOMMENDED?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

works for me!

Signed-off-by: Doug Davis <dug@us.ibm.com>
@duglin
Copy link
Collaborator Author

duglin commented Aug 16, 2019

thanks for the review @cneijenhuis

merging. Approved on the 8/15 call

@duglin duglin merged commit 42cf6eb into cloudevents:master Aug 16, 2019
@duglin duglin deleted the issue473 branch August 16, 2019 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to deal with odd chars in strings
5 participants