Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aws-stepfunctions] JsonPath does not support path with array: $[0] #9403

Closed
clementy28 opened this issue Aug 3, 2020 · 1 comment · Fixed by #10553
Closed

[aws-stepfunctions] JsonPath does not support path with array: $[0] #9403

clementy28 opened this issue Aug 3, 2020 · 1 comment · Fixed by #10553
Assignees
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p1

Comments

@clementy28
Copy link

clementy28 commented Aug 3, 2020

Caused by:

software.amazon.jsii.JsiiException: JSON path values must be exactly '$', '$$', start with '$.' or start with '$$.' Received: $[0].source.bucket
Error: JSON path values must be exactly '$', '$$', start with '$.' or start with '$$.' Received: $[0].source.bucket

Reproduction Steps

    private List<TaskEnvironmentVariable> environment() {
        return List.of(
                env("source_bucket", JsonPath.stringAt("$[0].source.bucket")),
                env("source_region", JsonPath.stringAt("$[0].source.region")),
                env("target_bucket", JsonPath.stringAt("$[0].target.bucket")),
                env("target_region", JsonPath.stringAt("$[0].target.region")),
                env("stream_name", JsonPath.stringAt("$[0].stream")),
                env("stream_region", JsonPath.stringAt("$[0].target.region")),
                env("credential_id", JsonPath.stringAt("$[0].source_credential_id")),
                env("token", JsonPath.getTaskToken()));
    }

Error Log

Caused by:

software.amazon.jsii.JsiiException: JSON path values must be exactly '$', '$$', start with '$.' or start with '$$.' Received: $[0].source.bucket
Error: JSON path values must be exactly '$', '$$', start with '$.' or start with '$$.' Received: $[0].source.bucket

Environment

  • CLI Version : 2
  • Framework Version: 1.56
  • Node.js Version:
  • OS : Darwin
  • Language (Version): Java 11

Other


This is 🐛 Bug Report

@clementy28 clementy28 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 3, 2020
@SomayaB SomayaB added the language/java Related to Java bindings label Aug 3, 2020
@SomayaB SomayaB changed the title [aws-cdk-java] JsonPath does not support path with array: $[0] [jsii] JsonPath does not support path with array: $[0] Aug 3, 2020
@shivlaks shivlaks added @aws-cdk/aws-stepfunctions Related to AWS StepFunctions p1 effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md and removed language/java Related to Java bindings needs-triage This issue or PR still needs to be triaged. labels Aug 4, 2020
@shivlaks shivlaks self-assigned this Aug 4, 2020
@shivlaks shivlaks changed the title [jsii] JsonPath does not support path with array: $[0] [aws-stepfunctions] JsonPath does not support path with array: $[0] Aug 4, 2020
@shivlaks
Copy link
Contributor

shivlaks commented Aug 4, 2020

for any interested contributors: code change to make is to loosen the validation (and add a test!)

@mergify mergify bot closed this as completed in #10553 Sep 29, 2020
mergify bot pushed a commit that referenced this issue Sep 29, 2020
Fix JsonPath not supporting array paths

closes #9403

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants