You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The StepFunctions implementation of JsonPath allow us to filter elements using the ?() syntax.
When I try to test a state machine that use a filter, the validation fails and if I try to bypass the validation, the engine returns an error.
The state machine should process the JsonPath filter.
Error
tate machine definition is invalid, see error(s) below:
SCHEMA_VALIDATION_FAILED: /States/ReturnResult/Parameters/completed_los.$ is invalid. must match format "asl_payload_template"
By setting checkPaths: false, the state machine is executed, but I get the following error:
ExecutionError: Execution has failed with the following error: jsonPath: subject_completed is not defined: @.subject_status==subject_completed
By changing the definition to wrap the condition with double quotes $.Payload[?(@.subject_status=="subject_completed")]..subject_id, it works, but unfortunately that doesn't work on step function:
Workaround
To make it work, I could pre-process the state machine definition to double quote any jsonpath expression, but that would be quite a good effort, moreover, I'm not keen to disable validations.
The text was updated successfully, but these errors were encountered:
This is an issue that has to do with the JSONPath library used in this project, which is jsonpath-plus. It seems this kind of syntax is not supported by that library. I too have noticed some path expressions which are valid in the AWS implementation do not work as expected in aws-local-stepfunctions, and vice versa.
Unfortunately, since JSONPath is not standardized, libraries tend to differ in its implementation. There's an RFC proposal to standardize the JSONPath spec, but that's still a draft.
The StepFunctions implementation of JsonPath allow us to filter elements using the
?()
syntax.When I try to test a state machine that use a filter, the validation fails and if I try to bypass the validation, the engine returns an error.
Step to reproduce
Desired outcome
The state machine should process the JsonPath filter.
Error
By setting
checkPaths: false
, the state machine is executed, but I get the following error:By changing the definition to wrap the condition with double quotes
$.Payload[?(@.subject_status=="subject_completed")]..subject_id
, it works, but unfortunately that doesn't work on step function:Workaround
To make it work, I could pre-process the state machine definition to double quote any jsonpath expression, but that would be quite a good effort, moreover, I'm not keen to disable validations.
The text was updated successfully, but these errors were encountered: