Skip to content

Commit 75c8118

Browse files
author
Doug Davis
authored
Merge pull request #340 from duglin/versionEventType
Add clarity text and an example of versioning eventTypes
2 parents 3918ab1 + 6fe49f2 commit 75c8118

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

primer.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ This document is a working draft.
1818
- [History](#history)
1919
- [CloudEvents Concepts](#cloudevents-concepts)
2020
- [Design Goals](#design-goals)
21+
- [Versioning of Attributes](#versioning-of-attributes)
2122
- [CloudEvent Attributes Extensions](#cloudevent-attribute-extensions)
2223
- [Qualifying Protocols and Encodings](#qualifying-protocols-and-encodings)
2324
- [Prior Art](#prior-art)
@@ -122,6 +123,25 @@ The following will not be part of the specification:
122123
* Language-specific runtime APIs
123124
* Selecting a single identity/access control system
124125

126+
## Versioning of Attributes
127+
128+
For certain CloudEvents attributes, the entity or data model referenced by its
129+
value might change over time. For example, `schemaurl` might be a reference
130+
one particular version of a schema document. Often these attribute values
131+
will then distinguish each variant by including some version-specific
132+
string as part of its value. For example, a version number (`v1`, `v2`), or a
133+
date (`2018-01-01`) might be used.
134+
135+
The CloudEvents specification does not mandate any particular pattern to
136+
be used, or even the use of version strings at all. This decision is up to
137+
each event producer. However, when a version-specific string is included,
138+
care should be taken whenever its value changes as event consumers might
139+
be reliant on the existing value and thus a change could be interpretted
140+
as a "breaking change". Some form of communication between producers and
141+
consumers should be established to ensure the event consumers know what
142+
possible values might be used. In general, this is true for all CloudEvents
143+
attributes as well.
144+
125145
## CloudEvent Attribute Extensions
126146

127147
In order to achieve the stated goals, the specification authors will attempt to

spec.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,18 @@ help intermediate gateways determine how to route the events.
176176
* Type: `String`
177177
* Description: Type of occurrence which has happened. Often this
178178
attribute is used for routing, observability, policy enforcement, etc.
179+
The format of this is producer defined and might include information such
180+
as the version of the `eventtype` - see
181+
[Versioning of Attributes in the Primer](primer.md#versioning-of-attributes)
182+
for more information.
179183
* Constraints:
180184
* REQUIRED
181185
* MUST be a non-empty string
182186
* SHOULD be prefixed with a reverse-DNS name. The prefixed domain dictates
183187
the organization which defines the semantics of this event type.
184188
* Examples
185189
* com.github.pull.create
190+
* com.example.object.delete.v2
186191

187192
### specversion
188193
* Type: `String`
@@ -229,7 +234,10 @@ help intermediate gateways determine how to route the events.
229234
### schemaurl
230235
* Type: `URI`
231236
* Description: A link to the schema that the `data` attribute adheres to.
232-
Incompatible changes to the schema SHOULD be reflected by a different URL.
237+
Incompatible changes to the schema SHOULD be reflected by a different URL.
238+
See
239+
[Versioning of Attributes in the Primer](primer.md#versioning-of-attributes)
240+
for more information.
233241
* Constraints:
234242
* OPTIONAL
235243
* If present, MUST adhere to the format specified in

0 commit comments

Comments
 (0)