-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloud-events-schema.json
75 lines (75 loc) · 3.17 KB
/
cloud-events-schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CloudEvents JSON Event Format",
"description": "JSON Event Format for CloudEvents",
"type": "object",
"properties": {
"cloudEventsVersion": {
"description": "The version of the CloudEvents specification",
"type": "string",
"enum": [
"0.1"
]
},
"eventType": {
"description": "Type of occurrence which has happened. Often this property is used for routing, observability, policy enforcement, etc.",
"type": "string"
},
"eventTypeVersion": {
"description": "The version of the eventType. This enables the interpretation of data by eventual consumers, requires the consumer to be knowledgeable about the producer.",
"type": "string"
},
"source": {
"description": "This describes the event producer. Often this will include information such as the type of the event source, the organization publishing the event, and some unique idenfitiers. The exact syntax and semantics behind the data encoded in the URI is event producer defined.",
"type": "string"
},
"eventID": {
"description": "ID of the event. The semantics of this string are explicitly undefined to ease the implementation of producers. Unique within the scope of the producer, Enable duplications between different producers.",
"type": "string"
},
"eventTime": {
"description": "Timestamp of when the event happened",
"type": "string"
},
"schemaURL": {
"description": "A link to the schema that the data attribute adheres to.",
"type": "string"
},
"contentType": {
"description": "Describe the data encoding format",
"type": "string"
},
"extensions": {
"description": "This is for additional metadata and this does not have a mandated structure. This enables a place for custom fields a producer or middleware might want to include and provides a place to test metadata before adding them to the CloudEvents specification",
"type": "object",
"properties": {
"traceparent": {
"type": "string",
"description": "Contains a version, trace ID, span ID, and trace options"
},
"tracestate": {
"type": "string",
"description": "a comma-delimited list of key-value pairs"
},
"rate": {
"type": "integer",
"description": "The rate at which this event has already been sampled. Represents the number of similar events that happened but were not sent plus this event. For example, if a system sees 30 occurrences and emits a single event, rate would be 30 (29 not sent and 1 sent). A value of 1 is the equivalent of this extension not being used at all"
}
},
"additionalProperties": true
},
"data": {
"description": "The event payload. The payload depends on the eventType, schemaURL and eventTypeVersion, the payload is encoded into a media format which is specified by the contentType attribute (e.g. application/json).",
"type": [
"object",
"string"
]
}
},
"required": [
"cloudEventsVersion",
"eventType",
"source",
"eventID"
]
}