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

Added datacontentencoding #387

Merged
merged 3 commits into from
Apr 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,29 @@ help intermediate gateways determine how to route the events.
[RFC 2046](https://tools.ietf.org/html/rfc2046)
* For Media Type examples see [IANA Media Types](http://www.iana.org/assignments/media-types/media-types.xhtml)

### datacontentencoding
* Type: `String` per [RFC 2045 Section 6.1](https://tools.ietf.org/html/rfc2045#section-6.1)
* Description: Describes the content encoding for the `data`
attribute for when the `data` field MUST be encoded as a string,
like with structured transport binding modes using the JSON event
format, but the `datacontenttype` indicates a non-string media
type. When the `data` field's effective data type is not `String`,
Copy link
Member

Choose a reason for hiding this comment

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

When the data field's effective data type is not String,
this attribute MUST NOT be set and MUST be ignored when set.

why not? I want to zip my http binary data payload...

Copy link
Member

Choose a reason for hiding this comment

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

Or I want to base64 encode my binary http payload because I am a weirdo...

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps not, looking at RFC 2045 I do not see anything I would want to use besides base64. And normal http transports can give me gzip...

/lgtm

this attribute MUST NOT be set and MUST be ignored when set.

The "Base64" value for the Base64 encoding as defined in [RFC 2045 Section 6.8](https://tools.ietf.org/html/rfc2045#section-6.8)
MUST be supported. When set, the event-format-encoded value of the `data`
attribute is a base64 string, but the effective data type of
the `data` attribute towards the application is the base64-decoded
binary array.

All other RFC2045 schemes are undefined for CloudEvents.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a "Constraints" section, like the other attributes?

I think at the moment, "Constraints" is "Must be the string 'Base64'". If so, would it make more sense to standardize on assuming 'Base64' encoding and excluding the other options?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@clemensv ^^^


* Constraints:
* The attribute MUST be set if the `data` attribute contains string-encoded
binary data. Otherwise the attribute MUST NOT be set.
* If present, MUST adhere to [RFC 2045 Section 6.1](https://tools.ietf.org/html/rfc2045#section-6.1)


## Data Attribute

As defined by the term [Data](#data), CloudEvents MAY include domain-specific
Expand Down