-
Notifications
You must be signed in to change notification settings - Fork 218
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 smithy-jmespath for parsing JMESPath #621
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JordonPhillips
requested changes
Nov 2, 2020
smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ExpressionVisitor.java
Show resolved
Hide resolved
smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/FunctionDefinition.java
Show resolved
Hide resolved
smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/LinterResult.java
Show resolved
Hide resolved
smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/Parser.java
Show resolved
Hide resolved
smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/TypeChecker.java
Outdated
Show resolved
Hide resolved
kstich
requested changes
Nov 3, 2020
smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/ComparatorType.java
Outdated
Show resolved
Hide resolved
smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/BinaryExpression.java
Show resolved
Hide resolved
...y-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/FilterProjectionExpression.java
Show resolved
Hide resolved
smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/LiteralExpression.java
Outdated
Show resolved
Hide resolved
...hy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/MultiSelectHashExpression.java
Outdated
Show resolved
Hide resolved
smithy-jmespath/src/test/java/software/amazon/smithy/jmespath/RunnerTest.java
Outdated
Show resolved
Hide resolved
smithy-jmespath/src/test/java/software/amazon/smithy/jmespath/ast/LiteralExpressionTest.java
Show resolved
Hide resolved
smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/TypeChecker.java
Show resolved
Hide resolved
smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/IndexExpression.java
Outdated
Show resolved
Hide resolved
smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/TypeChecker.java
Outdated
Show resolved
Hide resolved
kstich
approved these changes
Nov 3, 2020
JordonPhillips
approved these changes
Nov 3, 2020
We will be using JMESPath in things like waiters, so we need a JMESPath parser that has no dependencies, exposes a rich AST that can be used in code generation, and performs static analysis of expressions.
Waiters are a client-side abstraction used to poll a resource until a desired state is reached, or until it is determined that the resource will never enter into the desired state. Waiters have been available in AWS SDKs since around 2012, and are now part of Smithy as an additional specification. Note that this PR relies on smithy-jmespath.
This commit makes a few changes to waiters: 1. I removed and, or, and not. I couldn't think of a real use case for these as I was documenting them, so I am erring on the side of simplicity. 2. I removed the emptyArray comparator. This need more work to properly validate and specify it, and it can actually be acheived using a booleanEquals comparator by checking if a returned length of a value in JMESPath is equal to 0. No need for an extra comparator. 3. I added a new matcher named `inputOutput` that has two top level keys: input and output. This allows both input and output data to be queried *together* for successful operations, solving a longstanding use case we've had for things like making sure the number of autoscaling groups on input matches the number returned on output. 4. Given that and, or, and not was removed, there's no purpose for a standalone "input" matcher, particularly since there's now an "inputOutput" matcher.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We will be using JMESPath in things like waiters, so we need a JMESPath
parser that has no dependencies, exposes a rich AST that can be used in
code generation, and performs static analysis of expressions.
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.