Skip to content

Commit acbfb8c

Browse files
authored
Update the specification.md and events.json to make both source and type eventDef properties optional (#678)
1 parent 494e7a6 commit acbfb8c

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

schema/events.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,21 @@
7474
"additionalProperties": false,
7575
"if": {
7676
"properties": {
77-
"kind": {
78-
"const": "consumed"
77+
"source": {
78+
"type": "null"
7979
}
8080
}
8181
},
8282
"then": {
8383
"required": [
8484
"name",
85-
"source",
8685
"type"
8786
]
8887
},
8988
"else": {
9089
"required": [
9190
"name",
92-
"type"
91+
"source"
9392
]
9493
}
9594
},

specification.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3320,8 +3320,8 @@ It's worth noting that if an [auth definition](#Auth-Definition) has been define
33203320
| Parameter | Description | Type | Required |
33213321
| --- | --- | --- | --- |
33223322
| name | Unique event name | string | yes |
3323-
| source | CloudEvent source | string | yes if kind is set to "consumed", otherwise no |
3324-
| type | CloudEvent type | string | yes |
3323+
| source | CloudEvent source | string | no if `type` is set, otherwise yes. If not set when `kind` is `produced`, runtimes are expected to use a default value, such as https://serverlessworkflow.io in order to comply with the [CloudEvent spec constraints](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) |
3324+
| type | CloudEvent type | string | no if `source` is set, otherwise yes |
33253325
| kind | Defines the event is either `consumed` or `produced` by the workflow. Default is `consumed` | enum | no |
33263326
| [correlation](#Correlation-Definition) | Define event correlation rules for this event. Only used for consumed events | array | no |
33273327
| dataOnly | If `true` (default value), only the Event payload is accessible to consuming Workflow states. If `false`, both event payload and context attributes should be accessible | boolean | no |

0 commit comments

Comments
 (0)