Skip to content
Merged
Show file tree
Hide file tree
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
38 changes: 19 additions & 19 deletions amqp-transport-binding.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This document is a working draft.
- 1.4. [Event Formats](#14-event-formats)
- 1.5. [Security](#15-security)
2. [Use of CloudEvents Attributes](#2-use-of-cloudevents-attributes)
- 2.1. [contentType Attribute](#21-contenttype-attribute)
- 2.1. [contenttype Attribute](#21-contenttype-attribute)
- 2.2. [data Attribute](#22-data-attribute)
3. [AMQP Message Mapping](#3-amqp-message-mapping)
- 3.2. [Binary Content Mode](#31-binary-content-mode)
Expand Down Expand Up @@ -65,7 +65,7 @@ using an [event format](#14-event-formats).

In the *binary* content mode, the value of the event `data` attribute is placed
into the AMQP message's [application data][data] section as-is, with
the `contentType` attribute value declaring its media type; all other event
the `contenttype` attribute value declaring its media type; all other event
attributes are mapped to the AMQP [application-properties][app-properties] section.

### 1.4. Event Formats
Expand All @@ -86,31 +86,31 @@ mandate specific existing features to be used.
This specification does not further define any of the [CloudEvents][CE] event
attributes.

Two of the event attributes, `contentType` and `data` are handled specially
Two of the event attributes, `contenttype` and `data` are handled specially
and mapped onto AMQP constructs, all other attributes are transferred as
metadata without further interpretation.

This mapping is intentionally robust against changes, including the addition
and removal of event attributes, and also accommodates vendor extensions to the
event metadata. Any mention of event attributes other than `contentType` and
event metadata. Any mention of event attributes other than `contenttype` and
`data` is exemplary.

### 2.1. contentType Attribute
### 2.1. contenttype Attribute

The `contentType` attribute is assumed to contain a [RFC2046][RFC2046]
The `contenttype` attribute is assumed to contain a [RFC2046][RFC2046]
compliant media-type expression.

### 2.2. data Attribute

The `data` attribute is assumed to contain opaque application data that is
encoded as declared by the `contentType` attribute.
encoded as declared by the `contenttype` attribute.

An application is free to hold the information in any in-memory representation
of its choosing, but as the value is transposed into AMQP as defined in this
specification, the assumption is that the `data` attribute value is made
available as a sequence of bytes.

For instance, if the declared `contentType` is
For instance, if the declared `contenttype` is
`application/json;charset=utf-8`, the expectation is that the `data` attribute
value is made available as [UTF-8][RFC3629] encoded JSON text for use in
AMQP.
Expand Down Expand Up @@ -140,7 +140,7 @@ efficient transfer and without transcoding effort.
#### 3.1.1. AMQP content-type

For the *binary* mode, the AMQP `content-type` property field value maps
directly to the CloudEvents `contentType` attribute.
directly to the CloudEvents `contenttype` attribute.

#### 3.1.2. Event Data Encoding

Expand All @@ -149,7 +149,7 @@ The [`data` attribute](#22-data-attribute) byte-sequence is used as the AMQP

#### 3.1.3. Metadata Headers

All [CloudEvents][CE] attributes with exception of `contentType` and `data`
All [CloudEvents][CE] attributes with exception of `contenttype` and `data`
MUST be individually mapped to and from the AMQP
[application-properties][app-properties] section, with exceptions noted
below.
Expand All @@ -172,9 +172,9 @@ Cloud Event attributes are prefixed with "cloudEvents:" for use in the

Examples:

* `eventTime` maps to `cloudEvents:eventTime`
* `eventID` maps to `cloudEvents:eventID`
* `cloudEventsVersion` maps to `cloudEvents:cloudEventsVersion`
* `eventtime` maps to `cloudEvents:eventtime`
* `eventid` maps to `cloudEvents:eventid`
* `cloudeventsversion` maps to `cloudEvents:cloudeventsversion`

##### 3.1.3.2 AMQP Application Property Values

Expand All @@ -195,10 +195,10 @@ content-type: application/json; charset=utf-8

----------- application-properties -----------

cloudEvents:cloudEventsVersion: "0.1"
cloudEvents:eventType: "com.example.someevent"
cloudEvents:eventTime: "2018-04-05T03:56:24Z"
cloudEvents:eventID: "1234-1234-1234"
cloudEvents:cloudeventsversion: "0.1"
cloudEvents:eventtype: "com.example.someevent"
cloudEvents:eventtime: "2018-04-05T03:56:24Z"
cloudEvents:eventid: "1234-1234-1234"
cloudEvents:source: "/mycontext/subcontext"
.... further attributes ...

Expand Down Expand Up @@ -257,8 +257,8 @@ content-type: application/cloudevents+json; charset=utf-8
------------- application-data --------------------------

{
"cloudEventsVersion" : "0.1",
"eventType" : "com.example.someevent",
"cloudeventsversion" : "0.1",
"eventtype" : "com.example.someevent",

... further attributes omitted ...

Expand Down
60 changes: 30 additions & 30 deletions http-transport-binding.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This document is a working draft.
- 1.4. [Event Formats](#14-event-formats)
- 1.5. [Security](#15-security)
2. [Use of CloudEvents Attributes](#2-use-of-cloudevents-attributes)
- 2.1. [contentType Attribute](#21-contenttype-attribute)
- 2.1. [contenttype Attribute](#21-contenttype-attribute)
- 2.2. [data Attribute](#22-data-attribute)
3. [HTTP Message Mapping](#3-http-message-mapping)
- 3.2. [Binary Content Mode](#31-binary-content-mode)
Expand Down Expand Up @@ -67,7 +67,7 @@ placed into the HTTP request or response body using an [event
format](#14-event-formats).

In the *binary* content mode, the value of the event `data` attribute is placed
into the HTTP request or response body as-is, with the `contentType` attribute
into the HTTP request or response body as-is, with the `contenttype` attribute
value declaring its media type; all other event attributes are mapped to HTTP
headers.

Expand All @@ -89,31 +89,31 @@ identically to [HTTP over TLS]([RFC2818][RFC2818]).
This specification does not further define any of the [CloudEvents][CE] event
attributes.

Two of the event attributes, `contentType` and `data` are handled specially
Two of the event attributes, `contenttype` and `data` are handled specially
and mapped onto HTTP constructs, all other attributes are transferred as
metadata without further interpretation.

This mapping is intentionally robust against changes, including the addition
and removal of event attributes, and also accommodates vendor extensions to the
event metadata. Any mention of event attributes other than `contentType` and
event metadata. Any mention of event attributes other than `contenttype` and
`data` is exemplary.

### 2.1. contentType Attribute
### 2.1. contenttype Attribute

The `contentType` attribute is assumed to contain a [RFC2046][RFC2046]
The `contenttype` attribute is assumed to contain a [RFC2046][RFC2046]
compliant media-type expression.

### 2.2. data Attribute

The `data` attribute is assumed to contain opaque application data that is
encoded as declared by the `contentType` attribute.
encoded as declared by the `contenttype` attribute.

An application is free to hold the information in any in-memory representation
of its choosing, but as the value is transposed into HTTP as defined in this
specification, the assumption is that the `data` attribute value is made
available as a sequence of bytes.

For instance, if the declared `contentType` is
For instance, if the declared `contenttype` is
`application/json;charset=utf-8`, the expectation is that the `data` attribute
value is made available as [UTF-8][RFC3629] encoded JSON text to HTTP.

Expand Down Expand Up @@ -144,7 +144,7 @@ efficient transfer and without transcoding effort.
#### 3.1.1. HTTP Content-Type

For the *binary* mode, the HTTP `Content-Type` value maps directly to the
CloudEvents `contentType` attribute.
CloudEvents `contenttype` attribute.

#### 3.1.2. Event Data Encoding

Expand All @@ -153,7 +153,7 @@ message body.

#### 3.1.3. Metadata Headers

All [CloudEvents][CE] attributes with exception of `contentType` and `data`
All [CloudEvents][CE] attributes with exception of `contenttype` and `data`
MUST be individually mapped to and from distinct HTTP message headers,
with exceptions noted below.

Expand All @@ -172,18 +172,18 @@ the time of the submission or revision.
Except for attributes [explicitly handled in this specification]
(#2-use-of-cloudevents-attributes), the naming convention for the
HTTP header mapping of well-known CloudEvents attributes is that
each attribute name MUST be prefixed with "CE-".
each attribute name MUST be prefixed with "ce-".

Examples:

* `eventTime` maps to `CE-EventTime`
* `eventID` maps to `CE-EventID`
* `cloudEventsVersion` maps to `CE-CloudEventsVersion`
* `eventtime` maps to `ce-eventtime`
* `eventid` maps to `ce-eventid`
* `cloudeventsversion` maps to `ce-cloudeventsversion`

`Map`-typed CloudEvents attributes MUST be flattened into a set
of HTTP headers, where by the name of each header carries the prefix
"CE-", an infix reflecting the map attribute followed by a dash
("-"), and the name of the map entry key, e.g. "CE-attrib-key".
"ce-", an infix reflecting the map attribute followed by a dash
("-"), and the name of the map entry key, e.g. "ce-attrib-key".

Note: per the [HTTP](https://tools.ietf.org/html/rfc7230#section-3.2)
specification, header names are case-insensitive.
Expand Down Expand Up @@ -220,11 +220,11 @@ request:
``` text
POST /someresource HTTP/1.1
Host: webhook.example.com
CE-CloudEventsVersion: "0.1"
CE-EventType: "com.example.someevent"
CE-EventTime: "2018-04-05T03:56:24Z"
CE-EventID: "1234-1234-1234"
CE-Source: "/mycontext/subcontext"
ce-cloudeventsversion: "0.1"
ce-eventtype: "com.example.someevent"
ce-eventtime: "2018-04-05T03:56:24Z"
ce-eventid: "1234-1234-1234"
ce-source: "/mycontext/subcontext"
.... further attributes ...
Content-Type: application/json; charset=utf-8
Content-Length: nnnn
Expand All @@ -238,11 +238,11 @@ This example shows a response containing an event:

``` text
HTTP/1.1 200 OK
CE-CloudEventsVersion: "0.1"
CE-EventType: "com.example.someevent"
CE-EventTime: "2018-04-05T03:56:24Z"
CE-EventID: "1234-1234-1234"
CE-Source: "/mycontext/subcontext"
ce-cloudeventsversion: "0.1"
ce-eventtype: "com.example.someevent"
ce-eventtime: "2018-04-05T03:56:24Z"
ce-eventid: "1234-1234-1234"
ce-source: "/mycontext/subcontext"
.... further attributes ...
Content-Type: application/json; charset=utf-8
Content-Length: nnnn
Expand Down Expand Up @@ -297,8 +297,8 @@ Content-Type: application/cloudevents+json; charset=utf-8
Content-Length: nnnn

{
"cloudEventsVersion" : "0.1",
"eventType" : "com.example.someevent",
"cloudeventsversion" : "0.1",
"eventtype" : "com.example.someevent",

... further attributes omitted ...

Expand All @@ -318,8 +318,8 @@ Content-Type: application/cloudevents+json; charset=utf-8
Content-Length: nnnn

{
"cloudEventsVersion" : "0.1",
"eventType" : "com.example.someevent",
"cloudeventsversion" : "0.1",
"eventtype" : "com.example.someevent",

... further attributes omitted ...

Expand Down
58 changes: 29 additions & 29 deletions json-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ The following table shows exemplary mappings:

| CloudEvents | Type | Exemplary JSON Value
|--------------------|----------|-------------------------------
| eventType | String | "com.example.someevent"
| cloudEventsVersion | String | "0.1"
| eventtype | String | "com.example.someevent"
| cloudeventsversion | String | "0.1"
| source | URI | "/mycontext"
| eventID | String | "1234-1234-1234"
| eventTime | Timestamp| "2018-04-05T17:31:00Z"
| contentType | String | "application/json"
| eventid | String | "1234-1234-1234"
| eventtime | Timestamp| "2018-04-05T17:31:00Z"
| contenttype | String | "application/json"
| data | String | "<much wow=\"xml\"/>"
| data | Binary | "Q2xvdWRFdmVudHM="
| data | Map | { "objA" : "vA", "objB", "vB" }
Expand Down Expand Up @@ -128,15 +128,15 @@ in [Section 2.3.](#23-mapping-any-typed-attributes), with one additional
rule:

If an implementation determines that the type of the `data` attribute is
`Binary` or `String`, it MUST inspect the `contentType` attribute to determine
`Binary` or `String`, it MUST inspect the `contenttype` attribute to determine
whether it is indicated that the data value contains JSON data.

If the `contentType` value is either ["application/json"][RFC4627] or any media type
If the `contenttype` value is either ["application/json"][RFC4627] or any media type
with a [structured +json suffix][RFC6839], the implementation MUST translate
the `data` attribute value into a [JSON value][JSON-Value], and set the `data`
attribute of the envelope JSON object to this JSON value.

If the `contentType` value does not follow the [structured +json suffix][RFC6839]
If the `contenttype` value does not follow the [structured +json suffix][RFC6839]
but is known to use JSON encoding, the implementation MUST translate the `data` attribute
value into a [JSON value][JSON-Value], and set the `data` attribute of the envelope
JSON object to this JSON value. Its typical examples are, but not limited to,
Expand All @@ -154,16 +154,16 @@ Example event with `String`-valued `data`:

``` JSON
{
"cloudEventsVersion" : "0.1",
"eventType" : "com.example.someevent",
"cloudeventsversion" : "0.1",
"eventtype" : "com.example.someevent",
"source" : "/mycontext",
"eventID" : "A234-1234-1234",
"eventTime" : "2018-04-05T17:31:00Z",
"comExampleExtension1" : "value",
"comExampleExtension2" : {
"eventid" : "A234-1234-1234",
"eventtime" : "2018-04-05T17:31:00Z",
"comexampleextension1" : "value",
"comexampleextension2" : {
"otherValue": 5
},
"contentType" : "text/xml",
"contenttype" : "text/xml",
"data" : "<much wow=\"xml\"/>"
}
```
Expand All @@ -172,16 +172,16 @@ Example event with `Binary`-valued data

``` JSON
{
"cloudEventsVersion" : "0.1",
"eventType" : "com.example.someevent",
"cloudeventsversion" : "0.1",
"eventtype" : "com.example.someevent",
"source" : "/mycontext",
"eventID" : "B234-1234-1234",
"eventTime" : "2018-04-05T17:31:00Z",
"comExampleExtension1" : "value",
"comExampleExtension2" : {
"eventid" : "B234-1234-1234",
"eventtime" : "2018-04-05T17:31:00Z",
"comexampleextension1" : "value",
"comexampleextension2" : {
"otherValue": 5
},
"contentType" : "application/vnd.apache.thrift.binary",
"contenttype" : "application/vnd.apache.thrift.binary",
"data" : "... base64 encoded string ..."
}
```
Expand All @@ -191,16 +191,16 @@ a `Map` or [JSON data](#31-special-handling-of-the-data-attribute) data:

``` JSON
{
"cloudEventsVersion" : "0.1",
"eventType" : "com.example.someevent",
"cloudeventsversion" : "0.1",
"eventtype" : "com.example.someevent",
"source" : "/mycontext",
"eventID" : "C234-1234-1234",
"eventTime" : "2018-04-05T17:31:00Z",
"comExampleExtension1" : "value",
"comExampleExtension2" : {
"eventid" : "C234-1234-1234",
"eventtime" : "2018-04-05T17:31:00Z",
"comexampleextension1" : "value",
"comexampleextension2" : {
"otherValue": 5
},
"contentType" : "application/json",
"contenttype" : "application/json",
"data" : {
"appinfoA" : "abc",
"appinfoB" : 123,
Expand Down
Loading