Skip to content

Commit

Permalink
fix: set choice state variable and path fields set to reference paths
Browse files Browse the repository at this point in the history
  • Loading branch information
massfords authored and ChristopheBougere committed Aug 25, 2023
1 parent 4efbaaf commit c33ac55
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 17 deletions.
27 changes: 27 additions & 0 deletions src/__tests__/definitions/invalid-choice-state-variable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"Comment": "Violates the rule: The values of Variable and Path fields in a comparison must be valid Reference Paths.",
"StartAt": "ChoiceState",
"States": {
"ChoiceState": {
"Type": "Choice",
"Choices": [
{
"Variable": "States.ArrayContains($.clients.unique, 'null')",
"NumericEquals": 1,
"Next": "FirstMatchState"
}
],
"Default": "DefaultState"
},

"FirstMatchState": {
"Type": "Pass",
"End": true
},

"DefaultState": {
"Type": "Pass",
"End": true
}
}
}
34 changes: 17 additions & 17 deletions src/schemas/choice.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "object",
"properties": {
"Variable": {
"type": "string"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"And": {
"type": "array",
Expand All @@ -33,7 +33,7 @@
"type": "boolean"
},
"BooleanEqualsPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"IsBoolean": {
"type": "boolean"
Expand All @@ -42,31 +42,31 @@
"type": "number"
},
"NumericEqualsPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"NumericGreaterThan": {
"type": "number"
},
"NumericGreaterThanPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"NumericGreaterThanEquals": {
"type": "number"
},
"NumericGreaterThanEqualsPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"NumericLessThan": {
"type": "number"
},
"NumericLessThanPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"NumericLessThanEquals": {
"type": "number"
},
"NumericLessThanEqualsPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"IsNumeric": {
"type": "boolean"
Expand All @@ -75,31 +75,31 @@
"type": "string"
},
"StringEqualsPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"StringGreaterThan": {
"type": "string"
},
"StringGreaterThanPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"StringGreaterThanEquals": {
"type": "string"
},
"StringGreaterThanEqualsPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"StringLessThan": {
"type": "string"
},
"StringLessThanPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"StringLessThanEquals": {
"type": "string"
},
"StringLessThanEqualsPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"StringMatches": {
"type": "string"
Expand All @@ -111,31 +111,31 @@
"type": "string"
},
"TimestampEqualsPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"TimestampGreaterThan": {
"type": "string"
},
"TimestampGreaterThanPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"TimestampGreaterThanEquals": {
"type": "string"
},
"TimestampGreaterThanEqualsPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"TimestampLessThan": {
"type": "string"
},
"TimestampLessThanPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"TimestampLessThanEquals": {
"type": "string"
},
"TimestampLessThanEqualsPath": {
"$ref": "paths.json#/definitions/asl_path"
"$ref": "paths.json#/definitions/asl_ref_path"
},
"IsTimestamp": {
"type": "boolean"
Expand Down

0 comments on commit c33ac55

Please sign in to comment.