Skip to content

Commit 94e9c13

Browse files
author
Tihomir Surdilovic
authored
update to top-level workflow properties in schema (#255)
Signed-off-by: Tihomir Surdilovic <[email protected]>
1 parent 61727da commit 94e9c13

File tree

4 files changed

+194
-238
lines changed

4 files changed

+194
-238
lines changed

schema/events.json

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@
44
"description": "Serverless Workflow specification - events schema",
55
"type": "object",
66
"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
7+
"oneOf": [
8+
{
9+
"type": "string",
10+
"format": "uri",
11+
"description": "URI to a resource containing event definitions (json or yaml)"
12+
},
13+
{
14+
"type": "array",
15+
"description": "Workflow CloudEvent definitions. Defines CloudEvents that can be consumed or produced",
16+
"items": {
17+
"type": "object",
18+
"$ref": "#/definitions/eventdef"
19+
},
20+
"minItems": 1
21+
}
22+
]
1423
},
1524
"required": [
1625
"events"

schema/functions.json

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@
44
"description": "Serverless Workflow specification - functions schema",
55
"type": "object",
66
"functions": {
7-
"type": "array",
8-
"description": "Workflow function definitions",
9-
"items": {
10-
"type": "object",
11-
"$ref": "#/definitions/function"
12-
},
13-
"minItems": 1
7+
"oneOf": [
8+
{
9+
"type": "string",
10+
"format": "uri",
11+
"description": "URI to a resource containing function definitions (json or yaml)"
12+
},
13+
{
14+
"type": "array",
15+
"description": "Workflow function definitions",
16+
"items": {
17+
"type": "object",
18+
"$ref": "#/definitions/function"
19+
},
20+
"minItems": 1
21+
}
22+
]
1423
},
1524
"required": [
1625
"functions"

schema/retries.json

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@
44
"description": "Serverless Workflow specification - retries schema",
55
"type": "object",
66
"retries": {
7-
"type": "array",
8-
"description": "Workflow Retry definitions. Define retry strategies that can be referenced in states onError definitions",
9-
"items": {
10-
"type": "object",
11-
"$ref": "#/definitions/retrydef"
12-
},
13-
"minItems": 1
7+
"oneOf": [
8+
{
9+
"type": "string",
10+
"format": "uri",
11+
"description": "URI to a resource containing retry definitions (json or yaml)"
12+
},
13+
{
14+
"type": "array",
15+
"description": "Workflow Retry definitions. Define retry strategies that can be referenced in states onError definitions",
16+
"items": {
17+
"type": "object",
18+
"$ref": "#/definitions/retrydef"
19+
},
20+
"minItems": 1
21+
}
22+
]
1423
},
1524
"required": [
1625
"retries"
@@ -37,20 +46,29 @@
3746
"description": "Static value by which the delay increases during each attempt (ISO 8601 time format)"
3847
},
3948
"multiplier": {
40-
"type": ["number", "string"],
49+
"type": [
50+
"number",
51+
"string"
52+
],
4153
"minimum": 0,
4254
"minLength": 1,
4355
"multipleOf": 0.01,
4456
"description": "Numeric value, if specified the delay between retries is multiplied by this value."
4557
},
4658
"maxAttempts": {
47-
"type": ["number","string"],
59+
"type": [
60+
"number",
61+
"string"
62+
],
4863
"minimum": 1,
4964
"minLength": 0,
5065
"description": "Maximum number of retry attempts."
5166
},
5267
"jitter": {
53-
"type": ["number","string"],
68+
"type": [
69+
"number",
70+
"string"
71+
],
5472
"minimum": 0,
5573
"maximum": 1,
5674
"description": "If float type, maximum amount of random time added or subtracted from the delay between each retry relative to total delay (between 0 and 1). If string type, absolute maximum amount of random time added or subtracted from the delay between each retry (ISO 8601 duration format)"

0 commit comments

Comments
 (0)