Skip to content

Commit afdbac9

Browse files
committed
Addressing Tiho's comments
Signed-off-by: Francisco Javier Tirado Sarti <[email protected]>
1 parent 62d1e0c commit afdbac9

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

roadmap/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ _Status description:_
4545
| ✏️️| Add SDKs for more languages (Python, PHP, Rust, etc) | |
4646
| ✏️️| Add more samples | |
4747
| ✏️️| Enforce SemVer `version` | |
48+
| ✏️️| Add `dataOutputSchema` | |
4849

4950
## <a name="v08"></a> Released version v0.8
5051

schema/workflow.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,44 @@
7676
}
7777
]
7878
},
79+
"dataOutputSchema": {
80+
"oneOf": [
81+
{
82+
"type": "string",
83+
"description": "URI of the JSON Schema used to validate the workflow data output",
84+
"minLength": 1
85+
},
86+
{
87+
"type": "object",
88+
"description": "Workflow data output schema definition",
89+
"properties": {
90+
"schema": {
91+
"oneof":[
92+
{
93+
"type": "string",
94+
"description": "URI of the JSON Schema used to validate the workflow data output",
95+
"minLength": 1
96+
},
97+
{
98+
"type": "object",
99+
"description": "The JSON Schema object used to validate the workflow data output",
100+
"$schema": "http://json-schema.org/draft-07/schema#"
101+
}
102+
]
103+
},
104+
"failOnValidationErrors": {
105+
"type": "boolean",
106+
"default": true,
107+
"description": "Determines if an exception should be thrown when the output model does not match the provided schema"
108+
}
109+
},
110+
"additionalProperties": false,
111+
"required": [
112+
"schema"
113+
]
114+
}
115+
]
116+
},
79117
"secrets": {
80118
"$ref": "secrets.json#/secrets"
81119
},

specification.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,13 +1863,16 @@ for example "machine learning", "monitoring", "networking", etc
18631863
The `dataInputSchema` and `dataOutputSchema` properties can be used to validate model against a defined JSON Schema.
18641864

18651865
The `dataInputSchema` property validates the [workflow data input](#Workflow-Data-Input). Validation should be performed before any states are executed. In case of
1866-
a starting [Event state](#Event-state), it is not used to validate its event payloads.
1866+
a starting [Event state](#Event-state), it is not used to validate its event payloads. The `failOnValidationErrors` property determines if workflow execution should continue in case of validation errors.
18671867

1868-
The `dataOutputSchema` property validates the [Workflow data output](#workflow-data-output). Validation should be performed when the process is finished.
1868+
The `dataOutputSchema` property validates the [Workflow data output](#workflow-data-output). Validation should be performed after workflow execution has finished successfully. Successfully means the workflow has completed an end state without errors.
1869+
The `failOnValidationErrors` property determines what should be done when the workflow output does not match the provided schema.
1870+
If `failOnValidationErrors` is true, an error should be thrown. If executed within a subprocess, that error might be handled by the parent workflow.
1871+
If `failOnValidationErrors` is false, it is up to the implementor to warn the user about that fact using any mean, except throwing an error. For example, printing a log.
18691872

18701873
Both properties can be expressed as object or string type.
18711874

1872-
If using object type, their `schema` property might be an URI, which points to the JSON schema used to validate the workflow data input, or it might be the JSON schema object. Their `failOnValidationErrors` property determines if workflow execution should continue in case of validation errors. The default value of `failOnValidationErrors` is `true`.
1875+
If using object type, their `schema` property might be an URI, which points to the JSON schema used to validate the workflow data input, or it might be the JSON schema object. `failOnValidationErrors` is optional, default value is `true`.
18731876

18741877
Example for Json schema reference
18751878

0 commit comments

Comments
 (0)