question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

datacontentencoding is not OPTIONAL

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
duglincommented, Aug 15, 2019

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:

if present, MUST be a non-empty string

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?

0reactions
duglincommented, Sep 5, 2019

Closed due to https://github.com/cloudevents/spec/pull/492 - if incorrect please let me know

Read more comments on GitHub >

github_iconTop Results From Across the Web

Class: CloudEvents::Event::V0
It supports the standard required and optional attributes defined in CloudEvents V0.3, ... The optional datacontentencoding field as a String object, ...
Read more >
CloudEventV03 | cloudevents-sdk - Lance Ball
[OPTIONAL] Describes the content encoding for the data attribute for when the data field MUST be encoded as a string, like with structured...
Read more >
Event - Go Packages
In v0.3, this field is superseded by DataContentEncoding ... EventContextReader are the methods required to be a reader of context ...
Read more >
Clemens Vasters (@clemensv@mastodon.online) on Twitter: "That ...
... of just 10 attributes: "specversion", "source", "id", "type" are required. ... "datacontenttype", "datacontentencoding", and "schemaurl" are optional.
Read more >
HTTP Request parse the data Content-Encoding "deflate"
HTTP Request parse the data Content-Encoding "deflate" · Ask Question. Asked 11 months ago ... Required, but never shown ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found