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

Add ability to serialize the JMESPath AST #1059

Merged
merged 2 commits into from
Jan 19, 2022
Merged

Conversation

mtdowling
Copy link
Member

This allows the JMESPath AST to be parsed, then modified, then reserialized. Use cases include things like being able to modify
JMESPath expressions found in waiters so that field extraction matches any normalization changes code generators make to object keys (e.g., using snake_case in Ruby as opposed to the member names provided in the model).

To test, every valid expression from the jmespath test suite is parsed, serialized, and reparsed. The originally parsed AST is compared against the reparsed AST to ensure they are equal. Every JMESPath expression used in AWS waiters is included as a test case too.

Issue #, if available:

Description of changes:

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

This allows the JMESPath AST to be parsed, then modified, then
reserialized. Use cases include things like being able to modify
JMESPath expressions found in waiters so that field extraction matches
any normalization changes code generators make to object keys (e.g.,
using snake_case in Ruby as opposed to the member names provided in the
model).
@mtdowling mtdowling requested a review from a team as a code owner January 14, 2022 20:27
@mullermp
Copy link
Contributor

Nice!

…ExpressionSerializer.java

Co-authored-by: Jordon Phillips <JordonPhillips@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants