aws-cdk
aws-cdk copied to clipboard
[aws-stepfunctions] JsonPath does not support path with array: $[0]
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: Bug Report
for any interested contributors: code change to make is to loosen the validation (and add a test!)