Skip to content

Commit

Permalink
Merge pull request #68 from ChristopheBougere/parameters-array
Browse files Browse the repository at this point in the history
Allowing array and object in Parameters
  • Loading branch information
ChristopheBougere authored Feb 17, 2021
2 parents 9797a7f + 6fb2d7b commit 8f609c8
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "asl-validator",
"version": "1.9.4",
"version": "1.9.5",
"description": "Amazon States Language validator",
"main": "./src/validator.js",
"bin": {
Expand Down
14 changes: 14 additions & 0 deletions src/__tests__/definitions/valid-parameters-array.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"StartAt": "pass-execution-details",
"States": {
"pass-execution-details": {
"Type": "Pass",
"Parameters": [{
"execution_id.$": "$$.Execution.Id",
"timestamp.$": "$$.Execution.StartTime"
}],
"ResultPath": "$.execution_details",
"End": true
}
}
}
14 changes: 14 additions & 0 deletions src/__tests__/definitions/valid-parameters-object.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"StartAt": "pass-execution-details",
"States": {
"pass-execution-details": {
"Type": "Pass",
"Parameters": {
"execution_id.$": "$$.Execution.Id",
"timestamp.$": "$$.Execution.StartTime"
},
"ResultPath": "$.execution_details",
"End": true
}
}
}
5 changes: 4 additions & 1 deletion src/schemas/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
"$ref": "http://asl-validator.cloud/state-machine#"
},
"Parameters": {
"type": "object"
"type": ["object", "array"],
"items": {
"type": "object"
}
},
"ResultSelector": {
"type": "object"
Expand Down
5 changes: 4 additions & 1 deletion src/schemas/parallel.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"pattern": "^Parallel$"
},
"Parameters": {
"type": "object"
"type": ["object", "array"],
"items": {
"type": "object"
}
},
"ResultSelector": {
"type": "object"
Expand Down
5 changes: 4 additions & 1 deletion src/schemas/pass.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
"type": "string"
},
"Parameters": {
"type": "object"
"type": ["object", "array"],
"items": {
"type": "object"
}
},
"Result": {}
},
Expand Down
5 changes: 4 additions & 1 deletion src/schemas/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@
"type": "object"
},
"Parameters": {
"type": "object"
"type": ["object", "array"],
"items": {
"type": "object"
}
}
},
"oneOf": [{
Expand Down

0 comments on commit 8f609c8

Please sign in to comment.