Conversation
…chema validation Reference: #600 This change will move the `PathMatches` expression to schema checking to be performed upfront and allow zero matches to be returned. Previously, valid expressions could be rejected errantly in cases of empty collection type values where the expression steps traversed deeper. Consumers of `PathMatches` should not be returned errors in those cases and instead will receive zero path matches, which they can choose whether that result is significant or not. Invalid expressions for the schema will still receive errors. While implementing the new expression to schema validation logic, the `basetypes.ObjectType` implementation was missing an error return for missing attributes which caused false positives. This was actually noticed previously, however a covering issue was not created to fix the behavior, but it is now being fixed as part of correctly implementing the expression to schema validation. Returning an error in this situation is considered the valid implementation detail as object types are statically defined based on the underlying map of attribute names to attribute types. It is never valid to step into a non-existent attribute name.
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes #600
This change will move the
PathMatchesexpression to schema validation to be performed upfront and allow zero matches to be returned. Previously, valid expressions could be rejected errantly in cases of empty collection type values where the expression steps traversed deeper. Consumers ofPathMatchesshould not be returned errors in those cases and instead will receive zero path matches, which they can choose whether that result is significant or not. Invalid expressions for the schema will still receive errors.While implementing the new expression to schema validation logic, the
basetypes.ObjectTypeimplementation was missing an error return for missing attributes which caused false positives. This was actually noticed previously, however a covering issue was not created to fix the behavior, but it is now being fixed as part of correctly implementing the expression to schema validation. Returning an error in this situation is considered the valid implementation detail as object types are statically defined based on the underlying map of attribute names to attribute types. It is never valid to step into a non-existent attribute name.