Skip to content

Commit

Permalink
Remove the version enums from schemas
Browse files Browse the repository at this point in the history
Including the spec version enums in schemas is problematic, because
every time the spec is updated it implies that all the event schemas
must be updated as well which in turn requires the event type versions
to be updated too, which is confusing since not all events are updated
when a new spec version is made.

To solve that issue, we remove the enum from the version property, a let
it be a non-empty string. The SDKs can use the event type and version to
download the schema and validate events.

When a new spec release is made, the $id in the schema of all events
still have to be updated, but that should not cause the version on the
event type to be updated.

Fixes #87

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
  • Loading branch information
afrittoli committed Nov 15, 2022
1 parent 835bd42 commit fb7904a
Show file tree
Hide file tree
Showing 33 changed files with 33 additions and 158 deletions.
6 changes: 1 addition & 5 deletions schemas/artifactpackaged.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/artifactpublished.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
5 changes: 1 addition & 4 deletions schemas/branchcreated.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
5 changes: 1 addition & 4 deletions schemas/branchdeleted.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/buildfinished.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/buildqueued.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/buildstarted.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
5 changes: 1 addition & 4 deletions schemas/changeabandoned.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
5 changes: 1 addition & 4 deletions schemas/changecreated.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
5 changes: 1 addition & 4 deletions schemas/changemerged.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
5 changes: 1 addition & 4 deletions schemas/changereviewed.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
5 changes: 1 addition & 4 deletions schemas/changeupdated.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/environmentcreated.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/environmentdeleted.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/environmentmodified.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/pipelinerunfinished.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/pipelinerunqueued.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/pipelinerunstarted.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/repositorycreated.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/repositorydeleted.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/repositorymodified.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/servicedeployed.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/servicepublished.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/serviceremoved.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/servicerolledback.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/serviceupgraded.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/taskrunfinished.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/taskrunstarted.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/testcasefinished.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/testcasequeued.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
6 changes: 1 addition & 5 deletions schemas/testcasestarted.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
"properties": {
"version": {
"type": "string",
"enum": [
"0.1.0",
"0.1.1"
],
"default": "0.1.1"
"minLength": 1
},
"id": {
"type": "string",
Expand Down
Loading

0 comments on commit fb7904a

Please sign in to comment.