-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
APIGW: fix VTL $input.path and $input.json #12774
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
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 19m 7s ⏱️ - 1h 26m 10s Results for commit 64fc1af. ± Comparison against base commit 67b3da6. This pull request removes 3748 tests.
|
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 36m 25s ⏱️ Results for commit 64fc1af. |
Test Results - Alternative Providers987 tests 589 ✅ 31m 24s ⏱️ Results for commit 64fc1af. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! 🚀 Thanks for the added test and the good pr comment!
The fix is looking good, we are starting to iron out a lot of those edge cases 🎉
Motivation
I've noticed while working on other kind of VTL template that we were not handling
$input.path
and$input.json
return values correctly when the body would be empty, or the JSONPath would point to a non-existent value or the body would not be JSON.There were several reasons:
extract_jsonpath
helper method from LocalStack builds the result in a list, and return an empty list if there are no result. Because of this, we can't differentiate if we're actually fetching an empty list via the JSONPath, or we actually did not find a match. We now properly returnNone
and verify behaviorinput.path
orinput.json
. In AWS, it does not fail but instead fallback to returningnull
Changes
extract_jsonpath
for VTL rendering to stop returning empty list when no matchinput.path
orinput.body
Testing
External run number: 15740672033 (good for this change)