Skip to content

Conversation

@MathieuGilbert
Copy link
Contributor

@MathieuGilbert MathieuGilbert commented Nov 8, 2025

Issue #35912

Closes #35912.

Reason for this change

The inability to use multiline JSONata expressions in certain places, for example:

Condition.jsonata(`{%
  false
%}`)

Description of changes

  • Add the "dotAll" flag to the private jsonata helper testing whether a string is wrapped in the Step Functions JSONata expression tags. The "s" flag allows the dot to match across newlines, enabling the use of well-formatted complex expressions.
    • Also considered String.startsWith and String.endsWith, but opted for the minimal change to preserve the existing regex which is also likely more performant.
  • Include unit tests for both helper functions in jsonata.ts.
  • Reuse isValidJsonataExpression where the same regex expression was used in condition.ts and task-utils.ts.

Describe any new or updated permissions being added

N/A

Description of how you validated changes

  • Unit tests were added including the multiline cases.
  • Existing integration test for Step Functions with JSONata was updated to have its Condition use a multi-line string.
  • A construct overriding Condition to use this regex for validation was successfully used in a local project to get around the current single-line limitation.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

… string is wrapped in the Step Functions JSONata expression tags. The "s" flag allows the dot to match across newlines, enabling the use of well-formatted complex expressions.

Include unit tests for both helper functions in jsonata.ts.
Reuse isValidJsonataExpression where the same regex expression was used in condition and task-utils.
@aws-cdk-automation aws-cdk-automation requested a review from a team November 8, 2025 06:13
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p1 labels Nov 8, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@MathieuGilbert MathieuGilbert changed the title bug(stepfunctions): allow multiline jsonata strings fix(stepfunctions): allow multiline jsonata strings Nov 8, 2025
@MathieuGilbert MathieuGilbert force-pushed the awsstepfunctions-multiline-jsonata branch from 983431b to 747dafd Compare November 8, 2025 06:24
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 11, 2025 00:01

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@alvazjor alvazjor self-assigned this Nov 24, 2025
@mergify
Copy link
Contributor

mergify bot commented Nov 24, 2025

Merge Queue Status Beta

✅ The pull request has been merged

This pull request spent 5 seconds in the queue, with no time waiting for CI.
The checks were run in-place.

Required conditions to merge

@mergify
Copy link
Contributor

mergify bot commented Nov 24, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 8805e13 into aws:main Nov 24, 2025
20 of 21 checks passed
@github-actions
Copy link
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2025
@MathieuGilbert MathieuGilbert deleted the awsstepfunctions-multiline-jsonata branch November 25, 2025 06:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-stepfunctions): Condition.jsonata does not support multiline string

3 participants