Repository navigation
fix(E3601): support state-level JSONata and JSONata numeric fields - #4947
Merged
kddejong merged 1 commit intoNov 3, 2026
Merged
Conversation
hoganbr-amzn
marked this pull request as ready for review
October 28, 2026 17:52
kddejong
force-pushed
the
fix/4881-jsonata-state-level
branch
from
November 3, 2026 22:45
362c7b7 to
e04868d
Compare
kddejong
approved these changes
Nov 3, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4947 +/- ##
=======================================
Coverage 94.80% 94.80%
=======================================
Files 441 441
Lines 16128 16148 +20
Branches 3130 3133 +3
=======================================
+ Hits 15290 15309 +19
Misses 463 463
- Partials 375 376 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available: Fixes #4881
Description of changes:
E3601 picks the JSONPath or JSONata schema from the top-level
QueryLanguageonly, so states that set their ownQueryLanguageare validated against the wrong schema. This change:QueryLanguage: JSONataagainst the JSONata state schema when the state machine uses JSONPath. A state withoutQueryLanguageinherits from the top-level field, not from a parent Map or Parallel state, so nested states keep the top-level language unless they set their own (docs).QueryLanguage,InputPathandOutputPathon Succeed states. Succeed now shares thecommondefinition with the other state types, so it also gains two errors that match Step Functions: a JSONPath Succeed withOutputis rejected (it passed before), and a JSONata Succeed withInputPathorOutputPathis rejected.ItemSelector.TimeoutSecondsandHeartbeatSeconds, and for MapMaxConcurrency,ToleratedFailureCountandToleratedFailurePercentage. Under JSONata the matching*Pathfields are rejected, along with WaitSecondsPathandTimestampPath, because Step Functions rejects them there.__init__instead of on every validation.The state-level JSONata routes are appended to the end of the
stateallOf, so theschema_pathof existing JSONPath errors does not change. In the existing "Invalid query languages" test, two route indices move (Task 5 to 13, Choice 0 to 8), and a JSONata Choice state now also reportsAndas an unexpected property, which Step Functions rejects too.Testing:
test_query_languagewith a case for each shape above, including the E3601: JSONata validation misses state-levelQueryLanguage,QueryLanguageon Succeed, and a string MapItemSelector#4881 template, plus the silent cases: a boundary value (TimeoutSeconds: 1), aRefin a numeric field, and aRefas a state'sQueryLanguage, and anFn::Ifas a state'sQueryLanguagethat expects one error from each branch, proving both are checked. The cases compare(message, path)pairs rather than fullValidationErrorobjects so that the expected values do not depend onallOfroute indices, and assert that every error comes from E3601.ValidateStateMachineDefinitionAPI (us-west-2, 2026-10-27): the E3601: JSONata validation misses state-levelQueryLanguage,QueryLanguageon Succeed, and a string MapItemSelector#4881 template, each shape above as its own definition, the matching invalid shapes (*Pathfields under JSONata,Outputon a JSONPath Succeed, out-of-range values), and a nested JSONata Map whose child state uses JSONPath. cfn-lint reports no error on any definition the API accepts.CREATE_COMPLETE). cfn-lint 1.58.0 reports 15 E3601 errors on it, and this branch reports none.test/fixtures/templates/good/still lints with no E3601 finding.Commands run:
deploy-template.yaml
Known gaps:
{% ... %}expression, so cfn-lint still accepts a plain string such as"TimeoutSeconds": "10". Apatterncheck would also apply to numbers, so it is left for a follow-up.QueryLanguage, so a state whoseQueryLanguageis a value cfn-lint cannot resolve (aRefto a parameter, including one withAllowedValuesor aDefault) is not validated. Before this change such a state was validated as JSONPath, which reported JSONata expression strings as errors.Fn::Ifis unaffected: each branch is checked. The testUnresolvable QueryLanguage on a state skips the staterecords this.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.