From 332d6a4c32153f267ac7124be2a186d80aae7e62 Mon Sep 17 00:00:00 2001 From: Elvin Hwang <31689968+elvin-hwang@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:31:08 -0800 Subject: [PATCH] Support JSONata and Variable fields (#159) Co-authored-by: Elvin Hwang --- src/json-schema/bundled.json | 483 +++++++++++++++----- src/json-schema/partial/base.json | 3 + src/json-schema/partial/choice_state.json | 39 ++ src/json-schema/partial/common.json | 49 ++ src/json-schema/partial/map_state.json | 139 +++++- src/json-schema/partial/parallel_state.json | 6 + src/json-schema/partial/pass_state.json | 3 + src/json-schema/partial/succeed_state.json | 3 + src/json-schema/partial/task_state.json | 34 +- src/json-schema/partial/wait_state.json | 23 +- src/tests/json-strings/validationStrings.ts | 315 +++++++++++++ src/tests/validation.test.ts | 145 ++++++ src/tests/yamlCompletion.test.ts | 1 + src/validation/validationSchema.ts | 39 +- 14 files changed, 1141 insertions(+), 141 deletions(-) diff --git a/src/json-schema/bundled.json b/src/json-schema/bundled.json index 06e9756fc..de27480bd 100644 --- a/src/json-schema/bundled.json +++ b/src/json-schema/bundled.json @@ -50,6 +50,9 @@ "Map" ] }, + "QueryLanguage": { + "$ref": "#/properties/QueryLanguage" + }, "Comment": { "$ref": "#/properties/Comment" } @@ -138,6 +141,17 @@ "array", "null" ] + }, + "Output": { + "type": [ + "number", + "string", + "boolean", + "object", + "array", + "null" + ], + "description": "A value to define the Output configuration of this task state." } } } @@ -181,6 +195,9 @@ "enum": [ "Succeed" ] + }, + "Output": { + "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/3/properties/Output" } } } @@ -306,19 +323,35 @@ "type": "object" }, "TimeoutSeconds": { - "$ref": "#/properties/TimeoutSeconds", - "description": "If the task runs longer than the specified seconds, this state fails with a States.Timeout error name. Must be a positive, non-zero integer. If not provided, the default value is 99999999. The count begins after the task has been started, for example, when ActivityStarted or LambdaFunctionStarted are logged in the Execution event history." + "oneOf": [ + { + "$ref": "#/properties/TimeoutSeconds", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "#/properties/States/additionalProperties/oneOf/7/allOf/3/properties/Items/oneOf/1" + } + ], + "description": "If the task runs longer than the specified seconds, this state fails with a States.Timeout error name. Must be a positive, non-zero integer, or a jsonata expression. If not provided, the default value is 99999999. The count begins after the task has been started, for example, when ActivityStarted or LambdaFunctionStarted are logged in the Execution event history." }, "TimeoutSecondsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath", + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath", "description": "If the task runs longer than the specified seconds, this state fails with a States.Timeout error. Specified using JsonPath syntax, to select the value from the state's input data." }, "HeartbeatSeconds": { - "$ref": "#/properties/TimeoutSeconds", - "description": "If more time than the specified seconds elapses between heartbeats from the task, this state fails with a States.Timeout error name. Must be a positive, non-zero integer less than the number of seconds specified in the TimeoutSeconds field. If not provided, the default value is 99999999. For Activities, the count begins when GetActivityTask receives a token and ActivityStarted is logged in the Execution event history." + "oneOf": [ + { + "$ref": "#/properties/TimeoutSeconds", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "#/properties/States/additionalProperties/oneOf/7/allOf/3/properties/Items/oneOf/1" + } + ], + "description": "If more time than the specified seconds elapses between heartbeats from the task, this state fails with a States.Timeout error name. Must be a positive, non-zero integer less than the number of seconds specified in the TimeoutSeconds field, or a jsonata expression. If not provided, the default value is 99999999. For Activities, the count begins when GetActivityTask receives a token and ActivityStarted is logged in the Execution event history." }, "HeartbeatSecondsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath", + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath", "description": "If more time than the specified seconds elapses between heartbeats from the task, this state fails with a States.Timeout error. Specified using JsonPath syntax, to select the value from the state's input data." }, "Retry": { @@ -400,8 +433,14 @@ } ] }, + "Output": { + "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/3/properties/Output" + }, "Comment": { "$ref": "#/properties/Comment" + }, + "Assign": { + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Assign" } }, "required": [ @@ -409,6 +448,25 @@ "Next" ] } + }, + "Arguments": { + "oneOf": [ + { + "type": "object", + "errorMessage": "Incorrect type. Expected one of object, JSONata expression." + }, + { + "$ref": "#/properties/States/additionalProperties/oneOf/7/allOf/3/properties/Items/oneOf/1" + } + ], + "description": "An object or JSONata expression to define the Argument of this task state." + }, + "Output": { + "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/3/properties/Output" + }, + "Assign": { + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Assign", + "description": "An object to define the variables to be assigned." } }, "required": [ @@ -439,6 +497,38 @@ "minItems": 1, "items": { "oneOf": [ + { + "errorMessage": "Incorrect type. Expected a valid choice state condition.", + "type": "object", + "properties": { + "Condition": { + "oneOf": [ + { + "type": "boolean", + "errorMessage": "Incorrect type. Expected one of boolean, JSONata expression." + }, + { + "$ref": "#/properties/States/additionalProperties/oneOf/7/allOf/3/properties/Items/oneOf/1" + } + ] + }, + "Assign": { + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Assign" + }, + "Next": { + "type": "string", + "description": "The state to transition to if there is an exact match between the input value and the comparison operator for this Choice Rule.", + "minLength": 1 + }, + "Comment": { + "$ref": "#/properties/Comment" + } + }, + "required": [ + "Condition", + "Next" + ] + }, { "type": "object", "properties": { @@ -451,9 +541,7 @@ "minLength": 1 }, "Next": { - "type": "string", - "description": "The state to transition to if there is an exact match between the input value and the comparison operator for this Choice Rule.", - "minLength": 1 + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" }, "Comment": { "$ref": "#/properties/Comment" @@ -472,7 +560,7 @@ "type": "string" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -494,7 +582,7 @@ "type": "string" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -516,7 +604,7 @@ "type": "string" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -538,7 +626,7 @@ "type": "string" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -560,7 +648,7 @@ "type": "number" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -582,7 +670,7 @@ "type": "number" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -604,7 +692,7 @@ "type": "number" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -626,7 +714,7 @@ "type": "number" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -648,7 +736,7 @@ "type": "number" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -670,7 +758,7 @@ "type": "boolean" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -693,7 +781,7 @@ "format": "date-time" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -712,10 +800,10 @@ "type": "object", "properties": { "TimestampGreaterThan": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/11/properties/TimestampEquals" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/12/properties/TimestampEquals" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -734,10 +822,10 @@ "type": "object", "properties": { "TimestampGreaterThanEquals": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/11/properties/TimestampEquals" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/12/properties/TimestampEquals" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -756,10 +844,10 @@ "type": "object", "properties": { "TimestampLessThan": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/11/properties/TimestampEquals" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/12/properties/TimestampEquals" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -778,10 +866,10 @@ "type": "object", "properties": { "TimestampLessThanEquals": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/11/properties/TimestampEquals" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/12/properties/TimestampEquals" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -800,7 +888,7 @@ "type": "object", "properties": { "And": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/17/properties/Or" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/18/properties/Or" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -821,7 +909,7 @@ "type": "array", "minItems": 1, "items": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/18/properties/Not" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/Not" } }, "Next": { @@ -848,7 +936,7 @@ "type": "string" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -866,7 +954,7 @@ "type": "string" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -884,7 +972,7 @@ "type": "string" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -902,7 +990,7 @@ "type": "string" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -920,7 +1008,7 @@ "type": "string" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -938,7 +1026,7 @@ "type": "number" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -956,7 +1044,7 @@ "type": "number" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -974,7 +1062,7 @@ "type": "number" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -992,7 +1080,7 @@ "type": "number" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -1010,7 +1098,7 @@ "type": "number" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -1043,7 +1131,7 @@ "type": "object", "properties": { "TimestampEquals": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/11/properties/TimestampEquals" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/12/properties/TimestampEquals" }, "Variable": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0" @@ -1061,7 +1149,7 @@ "type": "object", "properties": { "TimestampLessThan": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/11/properties/TimestampEquals" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/12/properties/TimestampEquals" }, "Variable": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0" @@ -1079,7 +1167,7 @@ "type": "object", "properties": { "TimestampGreaterThan": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/11/properties/TimestampEquals" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/12/properties/TimestampEquals" }, "Variable": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0" @@ -1097,7 +1185,7 @@ "type": "object", "properties": { "TimestampLessThanEquals": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/11/properties/TimestampEquals" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/12/properties/TimestampEquals" }, "Variable": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0" @@ -1115,7 +1203,7 @@ "type": "object", "properties": { "TimestampGreaterThanEquals": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/11/properties/TimestampEquals" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/12/properties/TimestampEquals" }, "Variable": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0" @@ -1133,7 +1221,7 @@ "type": "object", "properties": { "And": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/17/properties/Or" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/18/properties/Or" }, "Comment": { "$ref": "#/properties/Comment" @@ -1147,7 +1235,7 @@ "type": "object", "properties": { "Or": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/17/properties/Or" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/18/properties/Or" }, "Comment": { "$ref": "#/properties/Comment" @@ -1161,7 +1249,7 @@ "type": "object", "properties": { "Not": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/18/properties/Not" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/Not" }, "Comment": { "$ref": "#/properties/Comment" @@ -1175,10 +1263,10 @@ "type": "object", "properties": { "StringEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -1193,10 +1281,10 @@ "type": "object", "properties": { "StringLessThanPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -1211,10 +1299,10 @@ "type": "object", "properties": { "StringGreaterThanPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -1229,10 +1317,10 @@ "type": "object", "properties": { "StringLessThanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -1247,10 +1335,10 @@ "type": "object", "properties": { "StringGreaterThanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -1265,10 +1353,10 @@ "type": "object", "properties": { "NumericEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -1283,10 +1371,10 @@ "type": "object", "properties": { "NumericLessThanPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -1301,10 +1389,10 @@ "type": "object", "properties": { "NumericGreaterThanPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -1319,10 +1407,10 @@ "type": "object", "properties": { "NumericLessThanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -1337,10 +1425,10 @@ "type": "object", "properties": { "NumericGreaterThanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Comment": { "$ref": "#/properties/Comment" @@ -1355,7 +1443,7 @@ "type": "object", "properties": { "BooleanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0" @@ -1373,7 +1461,7 @@ "type": "object", "properties": { "TimestampEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0" @@ -1391,7 +1479,7 @@ "type": "object", "properties": { "TimestampLessThanPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0" @@ -1409,7 +1497,7 @@ "type": "object", "properties": { "TimestampGreaterThanPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0" @@ -1427,7 +1515,7 @@ "type": "object", "properties": { "TimestampLessThanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0" @@ -1445,7 +1533,7 @@ "type": "object", "properties": { "TimestampGreaterThanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0" @@ -1607,7 +1695,7 @@ "pattern": "\\$.*" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1626,10 +1714,10 @@ "type": "object", "properties": { "StringGreaterThanPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1648,10 +1736,10 @@ "type": "object", "properties": { "StringGreaterThanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1670,10 +1758,10 @@ "type": "object", "properties": { "StringLessThanPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1692,10 +1780,10 @@ "type": "object", "properties": { "StringLessThanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1714,10 +1802,10 @@ "type": "object", "properties": { "NumericEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1736,10 +1824,10 @@ "type": "object", "properties": { "NumericGreaterThanPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1758,10 +1846,10 @@ "type": "object", "properties": { "NumericGreaterThanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1780,10 +1868,10 @@ "type": "object", "properties": { "NumericLessThanPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1802,10 +1890,10 @@ "type": "object", "properties": { "NumericLessThanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1824,10 +1912,10 @@ "type": "object", "properties": { "BooleanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1846,10 +1934,10 @@ "type": "object", "properties": { "TimestampEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1868,10 +1956,10 @@ "type": "object", "properties": { "TimestampGreaterThanPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1890,10 +1978,10 @@ "type": "object", "properties": { "TimestampGreaterThanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1912,10 +2000,10 @@ "type": "object", "properties": { "TimestampLessThanPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -1934,10 +2022,10 @@ "type": "object", "properties": { "TimestampLessThanEqualsPath": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/19/properties/StringEqualsPath" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/20/properties/StringEqualsPath" }, "Variable": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Variable" + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/1/properties/Variable" }, "Next": { "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/0/properties/Next" @@ -2113,6 +2201,13 @@ "Default": { "type": "string", "description": "The name of the state to transition to if none of the Choice Rules match." + }, + "Output": { + "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/3/properties/Output" + }, + "Assign": { + "type": "object", + "description": "An object to define the variables to be assigned." } }, "required": [ @@ -2141,11 +2236,27 @@ ] }, "Seconds": { - "$ref": "#/properties/TimeoutSeconds", + "oneOf": [ + { + "$ref": "#/properties/TimeoutSeconds", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "#/properties/States/additionalProperties/oneOf/7/allOf/3/properties/Items/oneOf/1" + } + ], "description": "A time, in seconds, to wait before beginning the state specified in the \"Next\" field." }, "Timestamp": { - "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/11/properties/TimestampEquals", + "oneOf": [ + { + "$ref": "#/properties/States/additionalProperties/oneOf/4/allOf/2/properties/Choices/items/oneOf/12/properties/TimestampEquals", + "errorMessage": "Incorrect type. Expected one of timestamp, JSONata expression." + }, + { + "$ref": "#/properties/States/additionalProperties/oneOf/7/allOf/3/properties/Items/oneOf/1" + } + ], "description": "An absolute time to wait until beginning the state specified in the \"Next\" field.\n\nTimestamps must conform to the RFC3339 profile of ISO 8601, with the further restrictions that an uppercase T must separate the date and time portions, and an uppercase Z must denote that a numeric time zone offset is not present, for example, 2016-08-18T17:33:00Z." }, "SecondsPath": { @@ -2155,6 +2266,9 @@ "TimestampPath": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0", "description": "An absolute time to wait until beginning the state specified in the \"Next\" field, specified using a path from the state's input data." + }, + "Output": { + "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/3/properties/Output" } }, "oneOf": [ @@ -2241,6 +2355,12 @@ "Catch": { "$ref": "#/properties/States/additionalProperties/oneOf/3/allOf/3/properties/Catch", "description": "Contains an array of objects, called Catchers, that define a fallback state. This state is executed if the state encounters runtime errors and its retry policy is exhausted or isn't defined." + }, + "Arguments": { + "$ref": "#/properties/States/additionalProperties/oneOf/3/allOf/3/properties/Arguments" + }, + "Output": { + "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/3/properties/Output" } }, "required": [ @@ -2333,8 +2453,16 @@ ] }, "MaxItems": { - "type": "integer", - "description": "An integer that limits the number of data items passed to the Map state.", + "oneOf": [ + { + "type": "integer", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "#/properties/States/additionalProperties/oneOf/7/allOf/3/properties/Items/oneOf/1" + } + ], + "description": "An integer or JSONata expression that limits the number of data items passed to the Map state.", "minimum": 0 }, "MaxItemsPath": { @@ -2351,6 +2479,22 @@ "arn:aws:states:::s3:listObjectsV2" ] }, + "Arguments": { + "$ref": "#/properties/States/additionalProperties/oneOf/3/allOf/3/properties/Arguments", + "description": "A JSON object or JSONata expression that specifies the Amazon S3 bucket name and object key or prefix in which the dataset is stored.", + "properties": { + "Bucket": { + "type": "string", + "description": "A string that specifies the Amazon S3 bucket name in which the dataset is stored.", + "minLength": 1 + }, + "Key": { + "type": "string", + "description": "A string that specifies Amazon S3 object key in which the dataset is stored.", + "minLength": 1 + } + } + }, "Parameters": { "type": "object", "description": "A JSON object that specifies the Amazon S3 bucket name and object key or prefix in which the dataset is stored.", @@ -2380,20 +2524,42 @@ } }, "ItemSelector": { - "type": "object", - "description": "A JSON object that overrides each single element of the item array." + "type": [ + "number", + "string", + "boolean", + "object", + "array", + "null" + ], + "description": "A JSON object or value that overrides each single element of the item array." }, "ItemBatcher": { "type": "object", "description": "A JSON object that specifies how to batch the items for the ItemProcessor.", "properties": { "BatchInput": { - "type": "object", + "type": [ + "number", + "string", + "boolean", + "object", + "array", + "null" + ], "description": "Specifies a fixed JSON input to include in each batch passed to each child workflow execution." }, "MaxItemsPerBatch": { - "type": "integer", - "description": "An integer that limits the maximum number of items of each sub-array.", + "oneOf": [ + { + "type": "integer", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "#/properties/States/additionalProperties/oneOf/7/allOf/3/properties/Items/oneOf/1" + } + ], + "description": "An integer or JSONata expression that limits the maximum number of items of each sub-array.", "minimum": 1 }, "MaxItemsPerBatchPath": { @@ -2401,8 +2567,16 @@ "description": "A reference path to an integer that limits the maximum number of items of each sub-array." }, "MaxInputBytesPerBatch": { - "type": "integer", - "description": "An integer that limits the maximum size in bytes of each sub-array.", + "oneOf": [ + { + "type": "integer", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "#/properties/States/additionalProperties/oneOf/7/allOf/3/properties/Items/oneOf/1" + } + ], + "description": "An integer or JSONata expression that limits the maximum size in bytes of each sub-array.", "minimum": 1 }, "MaxInputBytesPerBatchPath": { @@ -2422,6 +2596,22 @@ "arn:aws:states:::s3:putObject" ] }, + "Arguments": { + "$ref": "#/properties/States/additionalProperties/oneOf/3/allOf/3/properties/Arguments", + "description": "A JSON object that specifies the Amazon S3 resource to export the results to.", + "properties": { + "Bucket": { + "type": "string", + "description": "A string that specifies the Amazon S3 bucket name to export the results to.", + "minLength": 1 + }, + "Prefix": { + "type": "string", + "description": "A string that specifies the Amazon S3 object prefix to export the results to.", + "minLength": 1 + } + } + }, "Parameters": { "type": "object", "description": "A JSON object that specifies the Amazon S3 resource to export the results to.", @@ -2487,13 +2677,35 @@ "description": "A string that uniquely identifies a Map state.", "minLength": 1 }, + "ToleratedFailurePercentage": { + "oneOf": [ + { + "type": "integer", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "#/properties/States/additionalProperties/oneOf/7/allOf/3/properties/Items/oneOf/1" + } + ], + "description": "An integer or JSONata expression that provides an upper bound on the percentage of items that may fail.", + "minimum": 0, + "maximum": 100 + }, "ToleratedFailurePercentagePath": { "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/1/properties/ResultPath/oneOf/0", "description": "A reference path to an integer that provides an upper bound on the percentage of items that may fail." }, "ToleratedFailureCount": { - "type": "integer", - "description": "An integer that provides an upper bound on how many items may fail.", + "oneOf": [ + { + "type": "integer", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "#/properties/States/additionalProperties/oneOf/7/allOf/3/properties/Items/oneOf/1" + } + ], + "description": "An integer or JSONata expression that provides an upper bound on how many items may fail.", "minimum": 0 }, "ToleratedFailureCountPath": { @@ -2501,7 +2713,15 @@ "description": "A reference path to an integer that provides an upper bound on how many items may fail." }, "MaxConcurrency": { - "type": "integer", + "oneOf": [ + { + "type": "integer", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "#/properties/States/additionalProperties/oneOf/7/allOf/3/properties/Items/oneOf/1" + } + ], "description": "Provides an upper bound on how many invocations of the Iterator may run in parallel.\n\nThe default value is 0, which places no limit on parallelism and iterations are invoked as concurrently as possible.", "minimum": 0 }, @@ -2517,6 +2737,22 @@ "Catch": { "$ref": "#/properties/States/additionalProperties/oneOf/3/allOf/3/properties/Catch", "description": "Contains an array of objects, called Catchers, that define a fallback state. This state is executed if the state encounters runtime errors and its retry policy is exhausted or isn't defined." + }, + "Items": { + "oneOf": [ + { + "type": "array", + "errorMessage": "Incorrect type. Expected one of array, JSONata expression." + }, + { + "type": "string", + "pattern": "^{%(.*)%}$" + } + ], + "description": "An array or JSONata expression identifying where in the state input the array field is found." + }, + "Output": { + "$ref": "#/properties/States/additionalProperties/oneOf/0/allOf/3/properties/Output" } } } @@ -2524,6 +2760,15 @@ } ] } + }, + "QueryLanguage": { + "type": "string", + "description": "ASL mode configuration. Specify either JSONata or JSONPath.", + "minLength": 1, + "enum": [ + "JSONata", + "JSONPath" + ] } }, "required": [ diff --git a/src/json-schema/partial/base.json b/src/json-schema/partial/base.json index 64531baa5..e3ad15f2e 100755 --- a/src/json-schema/partial/base.json +++ b/src/json-schema/partial/base.json @@ -22,6 +22,9 @@ }, "States": { "$ref": "states.json#/definitions/states" + }, + "QueryLanguage": { + "$ref": "common.json#/definitions/queryLanguage" } }, "required": [ diff --git a/src/json-schema/partial/choice_state.json b/src/json-schema/partial/choice_state.json index bf8d4e936..2bd6edf93 100755 --- a/src/json-schema/partial/choice_state.json +++ b/src/json-schema/partial/choice_state.json @@ -22,6 +22,10 @@ "minItems": 1, "items": { "oneOf": [ + { + "$ref": "#/definitions/jsonataCondition", + "errorMessage": "Incorrect type. Expected a valid choice state condition." + }, { "$ref": "#/definitions/topStringEquals" }, @@ -155,6 +159,12 @@ "Default": { "type": "string", "description": "The name of the state to transition to if none of the Choice Rules match." + }, + "Output": { + "$ref": "common.json#/definitions/output" + }, + "Assign": { + "$ref": "common.json#/definitions/assign" } }, "required": [ @@ -173,6 +183,35 @@ "description": "The state to transition to if there is an exact match between the input value and the comparison operator for this Choice Rule.", "minLength": 1 }, + "jsonataCondition": { + "type": "object", + "properties": { + "Condition": { + "oneOf": [ + { + "type": "boolean", + "errorMessage": "Incorrect type. Expected one of boolean, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ] + }, + "Assign": { + "$ref": "common.json#/definitions/assign" + }, + "Next": { + "$ref": "#/definitions/next" + }, + "Comment": { + "$ref": "common.json#/definitions/comment" + } + }, + "required": [ + "Condition", + "Next" + ] + }, "topStringEquals": { "type": "object", "properties": { diff --git a/src/json-schema/partial/common.json b/src/json-schema/partial/common.json index b4a7d6d85..9b2fe67ff 100755 --- a/src/json-schema/partial/common.json +++ b/src/json-schema/partial/common.json @@ -18,6 +18,9 @@ "Map" ] }, + "QueryLanguage": { + "$ref": "#/definitions/queryLanguage" + }, "Comment": { "$ref": "#/definitions/comment" } @@ -89,6 +92,15 @@ } } }, + "queryLanguage": { + "type": "string", + "description": "ASL mode configuration. Specify either JSONata or JSONPath.", + "minLength": 1, + "enum": [ + "JSONata", + "JSONPath" + ] + }, "comment": { "type": "string", "description": "A human-readable comment or description.", @@ -143,6 +155,10 @@ "type": "string", "pattern": "\\$.*" }, + "jsonata": { + "type": "string", + "pattern": "^{%(.*)%}$" + }, "parameters": { "type": [ "number", @@ -231,8 +247,14 @@ } ] }, + "Output": { + "$ref": "#/definitions/output" + }, "Comment": { "$ref": "#/definitions/comment" + }, + "Assign": { + "$ref": "#/definitions/assign" } }, "required": [ @@ -240,6 +262,33 @@ "Next" ] } + }, + "arguments": { + "oneOf": [ + { + "type": "object", + "errorMessage": "Incorrect type. Expected one of object, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ], + "description": "An object or JSONata expression to define the Argument of this task state." + }, + "output": { + "type": [ + "number", + "string", + "boolean", + "object", + "array", + "null" + ], + "description": "A value to define the Output configuration of this task state." + }, + "assign": { + "type": "object", + "description": "An object to define the variables to be assigned." } } } \ No newline at end of file diff --git a/src/json-schema/partial/map_state.json b/src/json-schema/partial/map_state.json index f10b3a179..6e5c8e51d 100755 --- a/src/json-schema/partial/map_state.json +++ b/src/json-schema/partial/map_state.json @@ -84,8 +84,16 @@ ] }, "MaxItems": { - "type": "integer", - "description": "An integer that limits the number of data items passed to the Map state.", + "oneOf": [ + { + "type": "integer", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ], + "description": "An integer or JSONata expression that limits the number of data items passed to the Map state.", "minimum": 0 }, "MaxItemsPath": { @@ -102,6 +110,22 @@ "arn:aws:states:::s3:listObjectsV2" ] }, + "Arguments": { + "$ref": "common.json#/definitions/arguments", + "description": "A JSON object or JSONata expression that specifies the Amazon S3 bucket name and object key or prefix in which the dataset is stored.", + "properties": { + "Bucket": { + "type": "string", + "description": "A string that specifies the Amazon S3 bucket name in which the dataset is stored.", + "minLength": 1 + }, + "Key": { + "type": "string", + "description": "A string that specifies Amazon S3 object key in which the dataset is stored.", + "minLength": 1 + } + } + }, "Parameters": { "type": "object", "description": "A JSON object that specifies the Amazon S3 bucket name and object key or prefix in which the dataset is stored.", @@ -131,20 +155,42 @@ } }, "ItemSelector": { - "type": "object", - "description": "A JSON object that overrides each single element of the item array." + "type": [ + "number", + "string", + "boolean", + "object", + "array", + "null" + ], + "description": "A JSON object or value that overrides each single element of the item array." }, "ItemBatcher": { "type": "object", "description": "A JSON object that specifies how to batch the items for the ItemProcessor.", "properties": { "BatchInput": { - "type": "object", + "type": [ + "number", + "string", + "boolean", + "object", + "array", + "null" + ], "description": "Specifies a fixed JSON input to include in each batch passed to each child workflow execution." }, "MaxItemsPerBatch": { - "type": "integer", - "description": "An integer that limits the maximum number of items of each sub-array.", + "oneOf": [ + { + "type": "integer", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ], + "description": "An integer or JSONata expression that limits the maximum number of items of each sub-array.", "minimum": 1 }, "MaxItemsPerBatchPath": { @@ -152,8 +198,16 @@ "description": "A reference path to an integer that limits the maximum number of items of each sub-array." }, "MaxInputBytesPerBatch": { - "type": "integer", - "description": "An integer that limits the maximum size in bytes of each sub-array.", + "oneOf": [ + { + "type": "integer", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ], + "description": "An integer or JSONata expression that limits the maximum size in bytes of each sub-array.", "minimum": 1 }, "MaxInputBytesPerBatchPath": { @@ -173,6 +227,22 @@ "arn:aws:states:::s3:putObject" ] }, + "Arguments": { + "$ref": "common.json#/definitions/arguments", + "description": "A JSON object that specifies the Amazon S3 resource to export the results to.", + "properties": { + "Bucket": { + "type": "string", + "description": "A string that specifies the Amazon S3 bucket name to export the results to.", + "minLength": 1 + }, + "Prefix": { + "type": "string", + "description": "A string that specifies the Amazon S3 object prefix to export the results to.", + "minLength": 1 + } + } + }, "Parameters": { "type": "object", "description": "A JSON object that specifies the Amazon S3 resource to export the results to.", @@ -238,13 +308,35 @@ "description": "A string that uniquely identifies a Map state.", "minLength": 1 }, + "ToleratedFailurePercentage": { + "oneOf": [ + { + "type": "integer", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ], + "description": "An integer or JSONata expression that provides an upper bound on the percentage of items that may fail.", + "minimum": 0, + "maximum": 100 + }, "ToleratedFailurePercentagePath": { "$ref": "common.json#/definitions/referencePath", "description": "A reference path to an integer that provides an upper bound on the percentage of items that may fail." }, "ToleratedFailureCount": { - "type": "integer", - "description": "An integer that provides an upper bound on how many items may fail.", + "oneOf": [ + { + "type": "integer", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ], + "description": "An integer or JSONata expression that provides an upper bound on how many items may fail.", "minimum": 0 }, "ToleratedFailureCountPath": { @@ -252,7 +344,15 @@ "description": "A reference path to an integer that provides an upper bound on how many items may fail." }, "MaxConcurrency": { - "type": "integer", + "oneOf": [ + { + "type": "integer", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ], "description": "Provides an upper bound on how many invocations of the Iterator may run in parallel.\n\nThe default value is 0, which places no limit on parallelism and iterations are invoked as concurrently as possible.", "minimum": 0 }, @@ -268,6 +368,21 @@ "Catch": { "$ref": "common.json#/definitions/catch", "description": "Contains an array of objects, called Catchers, that define a fallback state. This state is executed if the state encounters runtime errors and its retry policy is exhausted or isn't defined." + }, + "Items": { + "oneOf": [ + { + "type": "array", + "errorMessage": "Incorrect type. Expected one of array, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ], + "description": "An array or JSONata expression identifying where in the state input the array field is found." + }, + "Output": { + "$ref": "common.json#/definitions/output" } } } diff --git a/src/json-schema/partial/parallel_state.json b/src/json-schema/partial/parallel_state.json index 5649b5ea6..715cc6b61 100755 --- a/src/json-schema/partial/parallel_state.json +++ b/src/json-schema/partial/parallel_state.json @@ -55,6 +55,12 @@ "Catch": { "$ref": "common.json#/definitions/catch", "description": "Contains an array of objects, called Catchers, that define a fallback state. This state is executed if the state encounters runtime errors and its retry policy is exhausted or isn't defined." + }, + "Arguments": { + "$ref": "common.json#/definitions/arguments" + }, + "Output": { + "$ref": "common.json#/definitions/output" } }, "required": [ diff --git a/src/json-schema/partial/pass_state.json b/src/json-schema/partial/pass_state.json index f37b093dc..48f0d0729 100755 --- a/src/json-schema/partial/pass_state.json +++ b/src/json-schema/partial/pass_state.json @@ -22,6 +22,9 @@ "Parameters": { "$ref": "common.json#/definitions/parameters", "description": "Used to pass information to the API actions of connected resources. The Parameters can use a mix of static JSON, JsonPath and intrinsic functions." + }, + "Output": { + "$ref": "common.json#/definitions/output" } } } diff --git a/src/json-schema/partial/succeed_state.json b/src/json-schema/partial/succeed_state.json index b944d1d25..27b35dac4 100755 --- a/src/json-schema/partial/succeed_state.json +++ b/src/json-schema/partial/succeed_state.json @@ -15,6 +15,9 @@ "enum": [ "Succeed" ] + }, + "Output": { + "$ref": "common.json#/definitions/output" } } } diff --git a/src/json-schema/partial/task_state.json b/src/json-schema/partial/task_state.json index 2bb0b64ef..7f89e6514 100755 --- a/src/json-schema/partial/task_state.json +++ b/src/json-schema/partial/task_state.json @@ -80,16 +80,32 @@ "description": "Used to transform the result. The ResultSelector can use a mix of static JSON, JsonPath and intrinsic functions." }, "TimeoutSeconds": { - "$ref": "common.json#/definitions/seconds", - "description": "If the task runs longer than the specified seconds, this state fails with a States.Timeout error name. Must be a positive, non-zero integer. If not provided, the default value is 99999999. The count begins after the task has been started, for example, when ActivityStarted or LambdaFunctionStarted are logged in the Execution event history." + "oneOf": [ + { + "$ref": "common.json#/definitions/seconds", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ], + "description": "If the task runs longer than the specified seconds, this state fails with a States.Timeout error name. Must be a positive, non-zero integer, or a jsonata expression. If not provided, the default value is 99999999. The count begins after the task has been started, for example, when ActivityStarted or LambdaFunctionStarted are logged in the Execution event history." }, "TimeoutSecondsPath": { "$ref": "common.json#/definitions/path", "description": "If the task runs longer than the specified seconds, this state fails with a States.Timeout error. Specified using JsonPath syntax, to select the value from the state's input data." }, "HeartbeatSeconds": { - "$ref": "common.json#/definitions/seconds", - "description": "If more time than the specified seconds elapses between heartbeats from the task, this state fails with a States.Timeout error name. Must be a positive, non-zero integer less than the number of seconds specified in the TimeoutSeconds field. If not provided, the default value is 99999999. For Activities, the count begins when GetActivityTask receives a token and ActivityStarted is logged in the Execution event history." + "oneOf": [ + { + "$ref": "common.json#/definitions/seconds", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ], + "description": "If more time than the specified seconds elapses between heartbeats from the task, this state fails with a States.Timeout error name. Must be a positive, non-zero integer less than the number of seconds specified in the TimeoutSeconds field, or a jsonata expression. If not provided, the default value is 99999999. For Activities, the count begins when GetActivityTask receives a token and ActivityStarted is logged in the Execution event history." }, "HeartbeatSecondsPath": { "$ref": "common.json#/definitions/path", @@ -102,6 +118,16 @@ "Catch": { "$ref": "common.json#/definitions/catch", "description": "An array of objects, called Catchers, that define a fallback state. This state is executed if the state encounters runtime errors and its retry policy is exhausted or isn't defined." + }, + "Arguments": { + "$ref": "common.json#/definitions/arguments" + }, + "Output": { + "$ref": "common.json#/definitions/output" + }, + "Assign": { + "$ref": "common.json#/definitions/assign", + "description": "An object to define the variables to be assigned." } }, "required": [ diff --git a/src/json-schema/partial/wait_state.json b/src/json-schema/partial/wait_state.json index d8b10d384..730d4ee63 100755 --- a/src/json-schema/partial/wait_state.json +++ b/src/json-schema/partial/wait_state.json @@ -20,11 +20,27 @@ ] }, "Seconds": { - "$ref": "common.json#/definitions/seconds", + "oneOf": [ + { + "$ref": "common.json#/definitions/seconds", + "errorMessage": "Incorrect type. Expected one of integer, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ], "description": "A time, in seconds, to wait before beginning the state specified in the \"Next\" field." }, "Timestamp": { - "$ref": "common.json#/definitions/timestamp", + "oneOf": [ + { + "$ref": "common.json#/definitions/timestamp", + "errorMessage": "Incorrect type. Expected one of timestamp, JSONata expression." + }, + { + "$ref": "common.json#/definitions/jsonata" + } + ], "description": "An absolute time to wait until beginning the state specified in the \"Next\" field.\n\nTimestamps must conform to the RFC3339 profile of ISO 8601, with the further restrictions that an uppercase T must separate the date and time portions, and an uppercase Z must denote that a numeric time zone offset is not present, for example, 2016-08-18T17:33:00Z." }, "SecondsPath": { @@ -34,6 +50,9 @@ "TimestampPath": { "$ref": "common.json#/definitions/referencePath", "description": "An absolute time to wait until beginning the state specified in the \"Next\" field, specified using a path from the state's input data." + }, + "Output": { + "$ref": "common.json#/definitions/output" } }, "oneOf": [ diff --git a/src/tests/json-strings/validationStrings.ts b/src/tests/json-strings/validationStrings.ts index 943f73a35..aa007d593 100644 --- a/src/tests/json-strings/validationStrings.ts +++ b/src/tests/json-strings/validationStrings.ts @@ -2098,3 +2098,318 @@ export const documentTaskRetryInvalid = `{ } } }` + +export const documentTaskJSONata = `{ + "Comment": "A Catch example of the Amazon States Language using an AWS Lambda Function", + "StartAt": "Lambda Invoke", + "States": { + "Lambda Invoke": { + "Type": "Task", + "Resource": "arn:aws:states:::lambda:invoke", + "Output": "{% $states.result.Payload %}", + "Arguments": { + "FunctionName": "{% $states.function %}", + "Payload": "{% $states.input %}" + }, + "End": true, + "TimeoutSeconds": "{% $states.input.timeout %}", + "HeartbeatSeconds": "{% $states.input.heartbeat %}", + "Catch": [ + { + "ErrorEquals": [ + "States.ALL" + ], + "Output": "{% $states.result.Payload %}", + "Next": "Lambda Invoke" + } + ] + } + }, + "QueryLanguage": "JSONata" +}` + +export const documentTaskJSONataInvalid = `{ + "Comment": "A Catch example of the Amazon States Language using an AWS Lambda Function", + "StartAt": "Lambda Invoke", + "States": { + "Lambda Invoke": { + "QueryLanguage": "notValid", + "Type": "Task", + "Resource": "arn:aws:states:::lambda:invoke", + "Output": "{% $states.result.Payload %}", + "Arguments": 123, + "End": true, + "TimeoutSeconds": false, + "HeartbeatSeconds": true, + "Catch": [ + { + "ErrorEquals": [ + "States.ALL" + ], + "Output": "{% $states.result.Payload %}", + "Next": "Lambda Invoke" + } + ] + } + } +}` + +export const documentMapJSONata = `{ + "QueryLanguage": "JSONPath", + "Comment": "A description of my state machine", + "StartAt": "Map", + "States": { + "Map": { + "Type": "Map", + "Items": "{% $states %}", + "ItemProcessor": { + "ProcessorConfig": { + "Mode": "DISTRIBUTED", + "ExecutionType": "STANDARD" + }, + "StartAt": "Pass", + "States": { + "Pass": { + "Type": "Pass", + "End": true + } + } + }, + "End": true, + "Label": "Map", + "MaxConcurrency": "{% $states %}", + "ItemReader": { + "Resource": "arn:aws:states:::s3:listObjectsV2", + "Arguments": { + "Bucket": "{% $states %}", + "Prefix": "{% $states %}" + }, + "ReaderConfig": { + "MaxItems": "{% $states %}" + } + }, + "ItemBatcher": { + "MaxItemsPerBatch": "{% $states %}", + "MaxInputBytesPerBatch": "{% $states %}", + "BatchInput": "{% $states %}" + }, + "ToleratedFailurePercentage": "{% $states %}", + "QueryLanguage": "JSONata", + "ItemSelector": "{% $states %}", + "ResultWriter": { + "Arguments": "{% $states %}" + } + } + } +}` + +export const documentParallelPassSuccessJSONata = `{ + "QueryLanguage": "JSONata", + "Comment": "A description of my state machine", + "StartAt": "Parallel", + "States": { + "Parallel": { + "Type": "Parallel", + "Branches": [ + { + "StartAt": "Pass", + "States": { + "Pass": { + "Type": "Pass", + "End": true, + "Output": { + "Placeholder": "{% $states %}" + } + } + } + }, + { + "StartAt": "Success", + "States": { + "Success": { + "Type": "Succeed", + "Output": "{% $states %}" + } + } + } + ], + "End": true, + "Arguments": "{% $states %}", + "Output": "{% $states %}" + } + } +}` + +export const documentChoiceWaitJSONata = `{ + "QueryLanguage": "JSONata", + "Comment": "A description of my state machine", + "StartAt": "Choice", + "States": { + "Choice": { + "Type": "Choice", + "Choices": [ + { + "Next": "Pass", + "Condition": "{% $states %}", + "Output": "{% $states %}" + } + ], + "Default": "Wait", + "Output": "{% $states %}" + }, + "Wait": { + "Type": "Wait", + "Timestamp": "{% $states %}", + "End": true + }, + "Pass": { + "Type": "Pass", + "End": true + } + } +}` + +export const documentTaskWithAssign = `{ + "Comment": "An example of the Amazon States Language using a Task state with Assign field", + "StartAt": "HelloWorld", + "States": { + "HelloWorld": { + "Type": "Task", + "Resource": "arn:aws:lambda:us-east-1:111111111111:function:myFunction", + "Assign": {}, + "Catch": [ + { + "ErrorEquals": [ + "States.ALL" + ], + "Next": "HelloWorld", + "Assign": {} + } + ], + "End": true + } + } +}` + +export const documentMapWithAssign = `{ + "StartAt": "Map", + "States": { + "Map": { + "Type": "Map", + "ItemsPath": "$.array", + "ResultPath": "$.array", + "MaxConcurrency": 2, + "Next": "Final State", + "ItemProcessor": { + "StartAt": "Pass", + "States": { + "Pass": { + "Type": "Pass", + "Result": "Done!", + "End": true + } + } + }, + "Assign": {} + }, + "Final State": { + "Type": "Pass", + "End": true + } + } +}` + +export const documentChoiceWithAssign = `{ + "Comment": "An example of the Amazon States Language using a Choice state with Assign field in the rule", + "StartAt": "Choice", + "States": { + "Choice": { + "Type": "Choice", + "Choices": [ + { + "Not": { + "Variable": "$", + "IsPresent": true + }, + "Assign": {}, + "Next": "Pass" + } + ], + "Default": "Pass" + }, + "Pass": { + "Type": "Pass", + "End": true, + "Assign": {} + } + } +}` + +export const documentParallelWithAssign = `{ + "Comment": "An example of the Amazon States Language using a Parallel state with Assign field", + "StartAt": "Parallel", + "States": { + "Parallel": { + "Type": "Parallel", + "Assign": {}, + "End": true, + "Branches": [ + { + "StartAt": "Pass", + "States": { + "Pass": { + "Type": "Pass", + "End": true + } + } + } + ] + } + } +}` + +export const documentWaitWithAssign = `{ + "Comment": "An example of the Amazon States Language using a Wait state with Assign field", + "StartAt": "HelloWorld", + "States": { + "HelloWorld": { + "Type": "Wait", + "Assign": {}, + "End": true + } + } +}` + +export const documentPassWithAssign = `{ + "Comment": "An example of the Amazon States Language using a Pass state with Assign field", + "StartAt": "HelloWorld", + "States": { + "HelloWorld": { + "Type": "Pass", + "Assign": {}, + "End": true + } + } +}` + +export const documentInvalidSuccessWithAssign = `{ + "Comment": "An example of the Amazon States Language using a Success state with Assign field", + "StartAt": "HelloWorld", + "States": { + "HelloWorld": { + "Type": "Succeed", + "Assign": {} + } + } +}` + +export const documentInvalidFailWithAssign = `{ + "Comment": "An example of the Amazon States Language using a Fail state with Assign field", + "StartAt": "HelloWorld", + "States": { + "HelloWorld": { + "Type": "Fail", + "Assign": {} + } + } +}` diff --git a/src/tests/validation.test.ts b/src/tests/validation.test.ts index 5a515bce7..83d47b385 100644 --- a/src/tests/validation.test.ts +++ b/src/tests/validation.test.ts @@ -16,6 +16,8 @@ import { documentChoiceNoDefault, documentChoiceValidDefault, documentChoiceValidNext, + documentChoiceWaitJSONata, + documentChoiceWithAssign, documentDistributedMapInvalidNextInNestedState, documentFailCauseAndCausePathInvalid, documentFailCausePathJsonPathInvalid, @@ -35,6 +37,7 @@ import { documentFailNoErrorAndCausePathValid, documentFailNoErrorAndCauseValid, documentFailNoErrorAndNoCauseValid, + documentInvalidFailWithAssign, documentInvalidNext, documentInvalidNextNested, documentInvalidParametersIntrinsicFunction, @@ -46,15 +49,21 @@ import { documentInvalidPropertiesState, documentInvalidResultSelectorIntrinsicFunction, documentInvalidResultSelectorJsonPath, + documentInvalidSuccessWithAssign, documentMapCatchTemplate, documentMapCatchTemplateInvalidNext, documentMapInvalidItemProcessorConfig, + documentMapJSONata, documentMapProcessorConfig, + documentMapWithAssign, documentNestedNoTerminalState, documentNestedUnreachableState, documentNoTerminalState, documentParallelCatchTemplate, documentParallelCatchTemplateInvalidNext, + documentParallelPassSuccessJSONata, + documentParallelWithAssign, + documentPassWithAssign, documentStartAtInvalid, documentStartAtNestedInvalid, documentStartAtValid, @@ -62,9 +71,12 @@ import { documentTaskCatchTemplate, documentTaskCatchTemplateInvalidNext, documentTaskInvalidArn, + documentTaskJSONata, + documentTaskJSONataInvalid, documentTaskRetryInvalid, documentTaskRetryValid, documentTaskValidVariableSubstitution, + documentTaskWithAssign, documentUnreachableState, documentValidAslImprovements, documentValidNext, @@ -1068,4 +1080,137 @@ suite('ASL context-aware validation', () => { }) }); }); + + suite('Test validation with JSONata fields', async () => { + test('does not show diagnostic error on valid states', async () => { + const validJSONataStates = [ + documentTaskJSONata, + documentMapJSONata, + documentParallelPassSuccessJSONata, + documentChoiceWaitJSONata, + ] + + validJSONataStates.forEach(async (definition) => { + await testValidations({ + json: definition, + diagnostics: [] + }) + }) + }) + + test('does show diagnostic error on invalid Task state', async () => { + await testValidations({ + json: documentTaskJSONataInvalid, + diagnostics: [{ + message: 'Value is not accepted. Valid values: \"JSONata\", \"JSONPath\".', + start: [5, 23], + end: [5, 33], + code: 1 + }, { + message: 'Incorrect type. Expected one of integer, JSONata expression.', + start: [11, 24], + end: [11, 29] + }, + { + message: 'Incorrect type. Expected one of integer, JSONata expression.', + start: [12, 26], + end: [12, 30], + }, + { + message: 'Incorrect type. Expected one of object, JSONata expression.', + start: [9, 19], + end: [9, 22] + }, + ] + }) + }) + }); + + suite('Assign property', async () => { + test('Should be valid for all state types', async () => { + const testCases = [ + documentTaskWithAssign, + documentMapWithAssign, + documentChoiceWithAssign, + documentParallelWithAssign, + documentPassWithAssign + ] + for (const jsonForTestCase of testCases) { + await testValidations({ + json: jsonForTestCase, + diagnostics: [] + }) + } + }) + + test('Should be valid in choice state when it is added at top level', async () => { + /* tslint:disable:no-unsafe-any */ + const asl = JSON.parse(documentChoiceWithAssign) + asl.States.Choice.Assign = {} + await testValidations({ + json: JSON.stringify(asl, undefined, 2), + diagnostics: [] + }) + }) + + test('Should be invalid when used in Success or Fail', async () => { + await testValidations({ + json: documentInvalidSuccessWithAssign, + diagnostics: [{ + message: MESSAGES.INVALID_PROPERTY_NAME, + start: [6, 10], + end: [6, 18] + }] + }) + await testValidations({ + json: documentInvalidFailWithAssign, + diagnostics: [{ + message: MESSAGES.INVALID_PROPERTY_NAME, + start: [6, 10], + end: [6, 18] + }] + }) + }) + + test('Should be valid if value is undefined', async () => { + /* tslint:disable:no-unsafe-any */ + const asl = JSON.parse(documentTaskWithAssign) + asl.States.HelloWorld.Assign = undefined + await testValidations({ + json: JSON.stringify(asl, undefined, 2), + diagnostics: [] + }) + }) + + test('Should be invalid for all non-object types', async () => { + const errorMessage = 'Incorrect type. Expected \"object\".' + /* tslint:disable:no-null-keyword */ + const assignCases = [null, 'NO', 1234, true] + for (const assignCase of assignCases) { + /* tslint:disable:no-unsafe-any */ + const asl = JSON.parse(documentTaskWithAssign) + asl.States.HelloWorld.Assign = assignCase + await testValidations({ + json: JSON.stringify(asl, undefined, 2), + diagnostics: [{ + message: errorMessage, + start: [7, 16], + end: [7, 20] + }] + }) + } + + /* tslint:disable:no-unsafe-any */ + const aslWithArrayForAssign = JSON.parse(documentTaskWithAssign) + aslWithArrayForAssign.States.HelloWorld.Assign = [''] + await testValidations({ + json: JSON.stringify(aslWithArrayForAssign, undefined, 2), + diagnostics: [{ + message: errorMessage, + start: [7, 16], + end: [9, 7] + }] + }) + }) + }); }) diff --git a/src/tests/yamlCompletion.test.ts b/src/tests/yamlCompletion.test.ts index a299ac2c5..63517a385 100644 --- a/src/tests/yamlCompletion.test.ts +++ b/src/tests/yamlCompletion.test.ts @@ -301,6 +301,7 @@ const topLevelLabels = [ 'TimeoutSeconds', 'StartAt', 'States', + 'QueryLanguage' ] const stateSnippetLabels = [ 'Pass State', diff --git a/src/validation/validationSchema.ts b/src/validation/validationSchema.ts index 2ca180d26..c11e5860f 100644 --- a/src/validation/validationSchema.ts +++ b/src/validation/validationSchema.ts @@ -10,19 +10,23 @@ export default { Comment: true, InputPath: true, OutputPath: true, + QueryLanguage: true, Type: true }, StateTypes: { Pass: { Properties: { + Assign: true, Result: true, ResultPath: true, - Parameters: true + Parameters: true, + Output: true, }, hasCommonProperties: true }, Task: { Properties: { + Assign: true, Resource: true, Parameters: true, Credentials: true, @@ -37,7 +41,9 @@ export default { }, Catch: { 'Fn:ArrayOf': 'Catcher' - } + }, + Arguments: true, + Output: true }, hasCommonProperties: true }, @@ -46,28 +52,35 @@ export default { Comment: true, InputPath: true, OutputPath: true, + QueryLanguage: true, Type: true, Choices: { 'Fn:ArrayOf': 'ChoiceRule' }, + Output: true, + Assign: true, Default: true, } }, Wait: { Properties: { + Assign: true, Seconds: true, Timestamp: true, SecondsPath: true, - TimestampPath: true + TimestampPath: true, + Output: true, }, hasCommonProperties: true }, Succeed: { Properties: { + QueryLanguage: true, Type: true, Comment: true, InputPath: true, OutputPath: true, + Output: true, } }, Fail: { @@ -77,15 +90,20 @@ export default { Cause: true, CausePath: true, Comment: true, + QueryLanguage: true, Type: true } }, Parallel: { Properties: { + QueryLanguage: true, + Assign: true, Branches: true, ResultPath: true, Parameters: true, ResultSelector: true, + Arguments: true, + Output: true, Retry: { 'Fn:ArrayOf': 'Retrier' }, @@ -97,11 +115,15 @@ export default { }, Map: { Properties: { + QueryLanguage: true, + Assign: true, Iterator: true, ItemsPath: true, + Items: true, MaxConcurrency: true, MaxConcurrencyPath: true, ResultPath: true, + Output: true, Parameters: true, ResultSelector: true, ItemReader: true, @@ -177,20 +199,26 @@ export default { }, ChoiceRule: { 'Fn:OneOf': 'ComparisonOperators', + Assign: true, Variable: true, + Condition: true, + Output: true, Next: true, Comment: true }, NestedChoiceRule: { 'Fn:OneOf': 'ComparisonOperators', + Assign: true, Variable: true, Comment: true }, Catcher: { ErrorEquals: true, ResultPath: true, + Output: true, Next: true, - Comment: true + Comment: true, + Assign: true, }, Retrier: { ErrorEquals: true, @@ -207,17 +235,20 @@ export default { StartAt: true, TimeoutSeconds: true, Version: true, + QueryLanguage: true, States: true }, // State machines nested within Map and Parallel states NestedParallelRoot: { Comment: true, StartAt: true, + QueryLanguage: true, States: true }, NestedMapRoot: { Comment: true, StartAt: true, + QueryLanguage: true, States: true, ProcessorConfig: true }