aws-cdk-lib/aws-apigateway: Step Functions Integration resultPath and outputPath issue #28310
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
When configuring Step Functions Integration in the CDK with different combinations of
resultPath
andoutputPath
, the response data behaves inconsistently, resulting in unexpected values for "Result" and "Payload".Expected Behavior
The integration should consistently provide both "Result" and "Payload" in the response data when defining resultPath and outputPath.
Current Behavior
With this code (Simplified version):
The expected return would be the full response with the "Payload" property with the data returned from the second function but this does not happen, depending on the combination of properties the response behaves in a weird way.
Cases:
outputPath: "$.Payload"
null
resultPath: "$.Result"
payloadResponseOnly: true, resultPath: "$.Result"
resultPath: "$.Result",outputPath: "$.Payload"
{ /* Expected data */ }
It seems like if the response is not changed or nothing is added, the return get's nulled out, but if only by adding "Result" as a property, the "Payload" gets populated.
Reproduction Steps
2 Lambdas:
This stack:
Possible Solution
Understand and maybe solve why this changes based on the different properties applied
Additional Information/Context
No response
CDK CLI Version
2.114.0 (build 12879fa)
Framework Version
No response
Node.js Version
v20.9.0
OS
Ubuntu 22.04.3 LTS
Language
TypeScript
Language Version
Typescript (3.9.10)
Other information
The text was updated successfully, but these errors were encountered: