Skip to content

Commit 95b10b0

Browse files
committed
Add jsonschema for a few of the events
Add initial jsonschemas for all of the events. These json schemas are automatically generated through the go types defined in the new cdevents/go-sdk, using the library github.com/invopop/jsonschema, see cdevents/sdk-go#6 for details. Signed-off-by: Andrea Frittoli <[email protected]>
1 parent 856bba6 commit 95b10b0

34 files changed

+2716
-0
lines changed

schemas/.keep

Whitespace-only changes.

schemas/artifactpackaged.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://github.com/cdevents/sdk-go/pkg/api/artifact-packaged-event",
4+
"properties": {
5+
"context": {
6+
"properties": {
7+
"version": {
8+
"type": "string",
9+
"enum": [
10+
"draft"
11+
],
12+
"default": "draft"
13+
},
14+
"id": {
15+
"type": "string",
16+
"minLength": 1
17+
},
18+
"source": {
19+
"type": "string",
20+
"minLength": 1
21+
},
22+
"type": {
23+
"type": "string",
24+
"minLength": 1
25+
},
26+
"timestamp": {
27+
"type": "string",
28+
"format": "date-time"
29+
}
30+
},
31+
"additionalProperties": false,
32+
"type": "object",
33+
"required": [
34+
"version",
35+
"id",
36+
"source",
37+
"type",
38+
"timestamp"
39+
]
40+
},
41+
"subject": {
42+
"properties": {
43+
"id": {
44+
"type": "string",
45+
"minLength": 1
46+
},
47+
"source": {
48+
"type": "string"
49+
},
50+
"type": {
51+
"type": "string",
52+
"minLength": 1
53+
},
54+
"content": {
55+
"properties": {},
56+
"additionalProperties": false,
57+
"type": "object"
58+
}
59+
},
60+
"additionalProperties": false,
61+
"type": "object",
62+
"required": [
63+
"id",
64+
"type",
65+
"content"
66+
]
67+
}
68+
},
69+
"additionalProperties": false,
70+
"type": "object",
71+
"required": [
72+
"context",
73+
"subject"
74+
]
75+
}

schemas/artifactpublished.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://github.com/cdevents/sdk-go/pkg/api/artifact-published-event",
4+
"properties": {
5+
"context": {
6+
"properties": {
7+
"version": {
8+
"type": "string",
9+
"enum": [
10+
"draft"
11+
],
12+
"default": "draft"
13+
},
14+
"id": {
15+
"type": "string",
16+
"minLength": 1
17+
},
18+
"source": {
19+
"type": "string",
20+
"minLength": 1
21+
},
22+
"type": {
23+
"type": "string",
24+
"minLength": 1
25+
},
26+
"timestamp": {
27+
"type": "string",
28+
"format": "date-time"
29+
}
30+
},
31+
"additionalProperties": false,
32+
"type": "object",
33+
"required": [
34+
"version",
35+
"id",
36+
"source",
37+
"type",
38+
"timestamp"
39+
]
40+
},
41+
"subject": {
42+
"properties": {
43+
"id": {
44+
"type": "string",
45+
"minLength": 1
46+
},
47+
"source": {
48+
"type": "string"
49+
},
50+
"type": {
51+
"type": "string",
52+
"minLength": 1
53+
},
54+
"content": {
55+
"properties": {},
56+
"additionalProperties": false,
57+
"type": "object"
58+
}
59+
},
60+
"additionalProperties": false,
61+
"type": "object",
62+
"required": [
63+
"id",
64+
"type",
65+
"content"
66+
]
67+
}
68+
},
69+
"additionalProperties": false,
70+
"type": "object",
71+
"required": [
72+
"context",
73+
"subject"
74+
]
75+
}

schemas/branchcreated.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://github.com/cdevents/sdk-go/pkg/api/branch-created-event",
4+
"properties": {
5+
"context": {
6+
"properties": {
7+
"version": {
8+
"type": "string",
9+
"enum": [
10+
"draft"
11+
],
12+
"default": "draft"
13+
},
14+
"id": {
15+
"type": "string",
16+
"minLength": 1
17+
},
18+
"source": {
19+
"type": "string",
20+
"minLength": 1
21+
},
22+
"type": {
23+
"type": "string",
24+
"minLength": 1
25+
},
26+
"timestamp": {
27+
"type": "string",
28+
"format": "date-time"
29+
}
30+
},
31+
"additionalProperties": false,
32+
"type": "object",
33+
"required": [
34+
"version",
35+
"id",
36+
"source",
37+
"type",
38+
"timestamp"
39+
]
40+
},
41+
"subject": {
42+
"properties": {
43+
"id": {
44+
"type": "string",
45+
"minLength": 1
46+
},
47+
"source": {
48+
"type": "string"
49+
},
50+
"type": {
51+
"type": "string",
52+
"minLength": 1
53+
},
54+
"content": {
55+
"properties": {},
56+
"additionalProperties": false,
57+
"type": "object"
58+
}
59+
},
60+
"additionalProperties": false,
61+
"type": "object",
62+
"required": [
63+
"id",
64+
"type",
65+
"content"
66+
]
67+
}
68+
},
69+
"additionalProperties": false,
70+
"type": "object",
71+
"required": [
72+
"context",
73+
"subject"
74+
]
75+
}

schemas/branchdeleted.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://github.com/cdevents/sdk-go/pkg/api/branch-deleted-event",
4+
"properties": {
5+
"context": {
6+
"properties": {
7+
"version": {
8+
"type": "string",
9+
"enum": [
10+
"draft"
11+
],
12+
"default": "draft"
13+
},
14+
"id": {
15+
"type": "string",
16+
"minLength": 1
17+
},
18+
"source": {
19+
"type": "string",
20+
"minLength": 1
21+
},
22+
"type": {
23+
"type": "string",
24+
"minLength": 1
25+
},
26+
"timestamp": {
27+
"type": "string",
28+
"format": "date-time"
29+
}
30+
},
31+
"additionalProperties": false,
32+
"type": "object",
33+
"required": [
34+
"version",
35+
"id",
36+
"source",
37+
"type",
38+
"timestamp"
39+
]
40+
},
41+
"subject": {
42+
"properties": {
43+
"id": {
44+
"type": "string",
45+
"minLength": 1
46+
},
47+
"source": {
48+
"type": "string"
49+
},
50+
"type": {
51+
"type": "string",
52+
"minLength": 1
53+
},
54+
"content": {
55+
"properties": {},
56+
"additionalProperties": false,
57+
"type": "object"
58+
}
59+
},
60+
"additionalProperties": false,
61+
"type": "object",
62+
"required": [
63+
"id",
64+
"type",
65+
"content"
66+
]
67+
}
68+
},
69+
"additionalProperties": false,
70+
"type": "object",
71+
"required": [
72+
"context",
73+
"subject"
74+
]
75+
}

schemas/buildfinished.json

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://github.com/cdevents/sdk-go/pkg/api/build-finished-event",
4+
"properties": {
5+
"context": {
6+
"properties": {
7+
"version": {
8+
"type": "string",
9+
"enum": [
10+
"draft"
11+
],
12+
"default": "draft"
13+
},
14+
"id": {
15+
"type": "string",
16+
"minLength": 1
17+
},
18+
"source": {
19+
"type": "string",
20+
"minLength": 1
21+
},
22+
"type": {
23+
"type": "string",
24+
"minLength": 1
25+
},
26+
"timestamp": {
27+
"type": "string",
28+
"format": "date-time"
29+
}
30+
},
31+
"additionalProperties": false,
32+
"type": "object",
33+
"required": [
34+
"version",
35+
"id",
36+
"source",
37+
"type",
38+
"timestamp"
39+
]
40+
},
41+
"subject": {
42+
"properties": {
43+
"id": {
44+
"type": "string",
45+
"minLength": 1
46+
},
47+
"source": {
48+
"type": "string"
49+
},
50+
"type": {
51+
"type": "string",
52+
"minLength": 1
53+
},
54+
"content": {
55+
"properties": {
56+
"artifactId": {
57+
"type": "string"
58+
}
59+
},
60+
"additionalProperties": false,
61+
"type": "object"
62+
}
63+
},
64+
"additionalProperties": false,
65+
"type": "object",
66+
"required": [
67+
"id",
68+
"type",
69+
"content"
70+
]
71+
}
72+
},
73+
"additionalProperties": false,
74+
"type": "object",
75+
"required": [
76+
"context",
77+
"subject"
78+
]
79+
}

0 commit comments

Comments
 (0)