Skip to content

Commit f69ff36

Browse files
authored
Update dataInputSchema property to allow for in-line schema def (#597)
* - Updated the `dataInputSchema.schema` property by allowing a Json Schema object value - Updated the `dataInputSchema` value object schema by making the `failOnValidationErrors` oprtional * Updated the specification.md by describing the object that can be used as `dataInputSchema/schema` value * Updated the roadmap's readme file * Update workflow.json
1 parent 68adedb commit f69ff36

File tree

3 files changed

+34
-6
lines changed

3 files changed

+34
-6
lines changed

roadmap/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ _Status description:_
3333
| ✔️| Update eventRef props to`produceEventRef` and `consumeEventRef` [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md#EventRef-Definition) |
3434
| ✔️| Update eventRef props to`resultEventTimeout` and `consumeEventTimeout` [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md#EventRef-Definition) |
3535
| ✔️| Apply fixes to auth spec schema [workflow schema](https://github.com/serverlessworkflow/specification/tree/main/schema) |
36+
| ✔️| Update the `dataInputSchema` top-level property by supporting the assignment of a JSON schema object [workflow schema](https://github.com/serverlessworkflow/specification/tree/main/specification.md#workflow-definition-structure) |
3637
| ✏️️| Add inline state defs in branches | |
3738
| ✏️️| Update rest function definition | |
3839
| ✏️️| Add "completedBy" functionality | |

schema/workflow.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,18 @@
4949
"description": "Workflow data input schema definition",
5050
"properties": {
5151
"schema": {
52-
"type": "string",
53-
"description": "URI of the JSON Schema used to validate the workflow data input",
54-
"minLength": 1
52+
"oneof":[
53+
{
54+
"type": "string",
55+
"description": "URI of the JSON Schema used to validate the workflow data input",
56+
"minLength": 1
57+
},
58+
{
59+
"type": "object",
60+
"description": "The JSON Schema object used to validate the workflow data input",
61+
"$schema": "http://json-schema.org/draft-07/schema#"
62+
}
63+
]
5564
},
5665
"failOnValidationErrors": {
5766
"type": "boolean",
@@ -61,8 +70,7 @@
6170
},
6271
"additionalProperties": false,
6372
"required": [
64-
"schema",
65-
"failOnValidationErrors"
73+
"schema"
6674
]
6775
}
6876
]

specification.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,26 @@ If it is an object type it has the following definition:
19281928
}
19291929
```
19301930

1931-
It's `schema` property is an URI which points to the JSON schema used to validate the workflow data input.
1931+
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.
1932+
If it's a JSON schema object, it has the following definition:
1933+
1934+
```json
1935+
"dataInputSchema": {
1936+
"schema": {
1937+
"title": "MyJSONSchema",
1938+
"properties":{
1939+
"firstName":{
1940+
"type": "string"
1941+
},
1942+
"lastName":{
1943+
"type": "string"
1944+
}
1945+
}
1946+
},
1947+
"failOnValidationErrors": false
1948+
}
1949+
1950+
```
19321951
It' `failOnValidationErrors` property determines if workflow execution should continue in case of validation
19331952
errors. The default value of `failOnValidationErrors` is `true`.
19341953
If `dataInputSchema` has the string type, it has the following definition:

0 commit comments

Comments
 (0)