Skip to content

Commit 62d1e0c

Browse files
committed
DataOutputSchema addition
This adds possibility of validation workflow output in a similar way that is already done for workflow input See issue #611 Signed-off-by: Francisco Javier Tirado Sarti <[email protected]>
1 parent 4aa5e0c commit 62d1e0c

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

specification.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,6 +1769,7 @@ definition "id" must be a constant value.
17691769
| version | Workflow version. MUST respect the [semantic versioning](https://semver.org/) format | string | no |
17701770
| annotations | List of helpful terms describing the workflows intended purpose, subject areas, or other important qualities | array | no |
17711771
| dataInputSchema | Used to validate the workflow data input against a defined JSON Schema| string or object | no |
1772+
| dataOutputSchema | Used to validate the workflow data output against a defined JSON Schema| string or object | no |
17721773
| [constants](#Workflow-Constants) | Workflow constants | string or object | no |
17731774
| [secrets](#Workflow-Secrets) | Workflow secrets | string or array | no |
17741775
| [start](#Start-Definition) | Workflow start definition | string or object | no |
@@ -1859,9 +1860,18 @@ The `version` property can be used to provide a specific workflow version. It mu
18591860
The `annotations` property defines a list of helpful terms describing the workflows intended purpose, subject areas, or other important qualities,
18601861
for example "machine learning", "monitoring", "networking", etc
18611862

1862-
The `dataInputSchema` property can be used to validate the workflow data input against a defined JSON Schema.
1863-
This check should be done before any states are executed. `dataInputSchema` can have two different types.
1864-
If it is an object type it has the following definition:
1863+
The `dataInputSchema` and `dataOutputSchema` properties can be used to validate model against a defined JSON Schema.
1864+
1865+
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.
1867+
1868+
The `dataOutputSchema` property validates the [Workflow data output](#workflow-data-output). Validation should be performed when the process is finished.
1869+
1870+
Both properties can be expressed as object or string type.
1871+
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`.
1873+
1874+
Example for Json schema reference
18651875

18661876
```json
18671877
"dataInputSchema": {
@@ -1870,11 +1880,10 @@ If it is an object type it has the following definition:
18701880
}
18711881
```
18721882

1873-
It's `schema` property can be an URI, which points to the JSON schema used to validate the workflow data input, or it can be the JSON schema object.
1874-
If it's a JSON schema object, it has the following definition:
1883+
Example for Json schema included in the workflow file
18751884

18761885
```json
1877-
"dataInputSchema": {
1886+
"dataOutputSchema": {
18781887
"schema": {
18791888
"title": "MyJSONSchema",
18801889
"properties":{
@@ -1886,23 +1895,19 @@ If it's a JSON schema object, it has the following definition:
18861895
}
18871896
}
18881897
},
1889-
"failOnValidationErrors": false
1898+
"failOnValidationErrors": true
18901899
}
18911900
18921901
```
1893-
It' `failOnValidationErrors` property determines if workflow execution should continue in case of validation
1894-
errors. The default value of `failOnValidationErrors` is `true`.
1895-
If `dataInputSchema` has the string type, it has the following definition:
1902+
1903+
If using string type, then the string value is the external schema URI and `failOnValidationErrors` default value of `true` is assumed.
1904+
1905+
Example using string type
18961906

18971907
```json
18981908
"dataInputSchema": "URL_to_json_schema"
18991909
```
19001910

1901-
In this case the `failOnValidationErrors` default value of `true` is assumed.
1902-
1903-
The `dataInputSchema` property validates the [workflow data input](#Workflow-Data-Input). In case of
1904-
a starting [Event state](#Event-state), it is not used to validate its event payloads.
1905-
19061911
The `secrets` property allows you to use sensitive information such as passwords, OAuth tokens, ssh keys, etc. inside your
19071912
Workflow expressions.
19081913

0 commit comments

Comments
 (0)