Skip to content

Commit 8922918

Browse files
committed
Add schemas
Signed-off-by: Ricardo Zanini <[email protected]>
1 parent 0fca4a3 commit 8922918

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+15265
-3
lines changed

_redirects

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# See: https://docs.netlify.com/routing/redirects/
22
# https://docs.netlify.com/routing/redirects/redirect-options/
3-
/schemas/previous/* /schemas/0.7/:splat 200
4-
/schemas/latest/* /schemas/0.8/:splat 200
5-
/schemas/snapshot/* /schemas/0.9/:splat 200
3+
/schemas/previous/* /schemas/0.8/:splat 200
4+
/schemas/latest/* /schemas/0.9/:splat 200
5+
/schemas/snapshot/* /schemas/1.0.0-alpha1/:splat 200

static/schemas/0.5/common.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$id": "https://serverlessworkflow.org/core/0.5/common.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"description": "Serverless Workflow specification - common schema",
5+
"type": "object",
6+
"definitions": {
7+
"metadata": {
8+
"type": "object",
9+
"description": "Metadata information",
10+
"additionalProperties": {
11+
"type": "string"
12+
}
13+
}
14+
}
15+
}

static/schemas/0.5/events.json

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{
2+
"$id": "https://serverlessworkflow.org/core/0.5/events.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"description": "Serverless Workflow specification - events schema",
5+
"type": "object",
6+
"events": {
7+
"type": "array",
8+
"description": "Workflow CloudEvent definitions. Defines CloudEvents that can be consumed or produced",
9+
"items": {
10+
"type": "object",
11+
"$ref": "#/definitions/eventdef"
12+
},
13+
"minItems": 1
14+
},
15+
"required": [
16+
"events"
17+
],
18+
"definitions": {
19+
"eventdef": {
20+
"type": "object",
21+
"properties": {
22+
"name": {
23+
"type": "string",
24+
"description": "Unique event name",
25+
"minLength": 1
26+
},
27+
"names": {
28+
"type": "array",
29+
"description": "List of unique event names that share the rest of the properties (source, type, kind, default)",
30+
"items": {
31+
"type": "string"
32+
},
33+
"minItems": 2,
34+
"uniqueItems": true
35+
},
36+
"source": {
37+
"type": "string",
38+
"description": "CloudEvent source"
39+
},
40+
"type": {
41+
"type": "string",
42+
"description": "CloudEvent type"
43+
},
44+
"kind": {
45+
"type": "string",
46+
"enum": [
47+
"consumed",
48+
"produced"
49+
],
50+
"description": "Defines the CloudEvent as either 'consumed' or 'produced' by the workflow. Default is 'consumed'",
51+
"default": "consumed"
52+
},
53+
"correlation": {
54+
"type": "array",
55+
"description": "CloudEvent correlation definitions",
56+
"minItems": 1,
57+
"items": {
58+
"type": "object",
59+
"$ref": "#/definitions/correlationDef"
60+
}
61+
},
62+
"metadata": {
63+
"$ref": "common.json#/definitions/metadata",
64+
"description": "Metadata information"
65+
}
66+
},
67+
"if": {
68+
"properties": {
69+
"kind": {
70+
"const": "consumed"
71+
}
72+
}
73+
},
74+
"then": {
75+
"oneOf": [
76+
{
77+
"required": [
78+
"name",
79+
"source",
80+
"type"
81+
]
82+
},
83+
{
84+
"required": [
85+
"names",
86+
"source",
87+
"type"
88+
]
89+
}
90+
]
91+
},
92+
"else": {
93+
"oneOf": [
94+
{
95+
"required": [
96+
"name",
97+
"type"
98+
]
99+
},
100+
{
101+
"required": [
102+
"names",
103+
"type"
104+
]
105+
}
106+
]
107+
}
108+
},
109+
"correlationDef": {
110+
"type": "object",
111+
"description": "CloudEvent correlation definition",
112+
"properties": {
113+
"contextAttributeName": {
114+
"type": "string",
115+
"description": "CloudEvent Extension Context Attribute name",
116+
"minLength": 1
117+
},
118+
"contextAttributeValue": {
119+
"type": "string",
120+
"description": "CloudEvent Extension Context Attribute value",
121+
"minLength": 1
122+
}
123+
},
124+
"required": [
125+
"contextAttributeName"
126+
]
127+
}
128+
}
129+
}

0 commit comments

Comments
 (0)