datacontentencoding is not OPTIONAL
See original GitHub issueThe notational convention states:
For clarity, when a feature is marked as “OPTIONAL” this means that it is OPTIONAL for the Producer […] of a message to support that feature. In other words, a producer can choose to include that feature in a message if it wants […]
The datacontentencoding
is listed as an OPTIONAL attribute, however producers MUST or MUST NOT set the attribute - in other words, they MUST support the feature (which can mean they have to omit the attribute):
The attribute MUST be set if the
data
attribute contains string-encoded binary data. Otherwise the attribute MUST NOT be set.
The same will be true for datacontenttype
if we adopt either #470 or #471 .
My suggestion is to either move them to REQUIRED attributes and clarify that this includes a requirement to NOT set the attribute, or to create a new section for attributes that are producers are REQUIRED to use correctly (incl. omitting them), but consumers have to handle them not being there.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
I’m not sure that kind of text is required since to me the text around the MUSTs makes it clear that if the condition specified is met, then the MUST applies. The classic example is:
The presence of this requirement in the “optional attributes” section doesn’t really change whether or not people are required to adhere to the MUST. Basically the word “OPTIONAL” in the header of the section is meaningless other than to say these attribute might appear while the ones in the REQUIRED section will appear. Perhaps we should find another word other than OPTIONAL for the title. Would that help? Or just title the section “Conditional Attributes” ??
But that’s just me 😃 If people think more text is needed, then we just need to find the right wording because not everything in that section is “conditional”. Perhaps something like this at the top of the “OPTIONAL and conditional attributes” section:
While the attributes listed in this section are not mandatory for all CloudEvents, some of them might be based the particular use case.
wdyt?
Closed due to https://github.com/cloudevents/spec/pull/492 - if incorrect please let me know