fix property selection dropping every renamed property - #597
Open
cportele wants to merge 1 commit into
Open
Conversation
The target schema of a query was built by applying the transformation chain and then pruning to the query's fields: .accept(withScope).accept(schemaTransformations).accept(new WithoutProperties(...)) A property selection is expressed in the technical property names of the feature schema -- that is what the queryables and presentables of an API are named after, and what the "properties" and "exclude-properties" parameters accept. The transformation chain renames properties: explicitly, through a configured rename, and implicitly through the alias renames injected for a format that encodes properties under their alias. Matching the selection after the chain therefore compared it against names that no longer existed, and every property whose name the chain had changed was pruned away. Only properties whose name survived the rename unchanged were left, so a selection could empty a response of its content without any error. Prune before the chain, so the selection is matched against the names it is written in, and the renames then apply to what survived. ProjectionBeforeRenameSpec locks the order in both directions: pruning first keeps the selected properties under their alias, pruning last keeps only the property the rename left alone.
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 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.
Closes ldproxy/ldproxy#1732
The target schema of a query was built by applying the transformation chain and then pruning to the query's fields:
.accept(withScope).accept(schemaTransformations).accept(new WithoutProperties(...))
A property selection is expressed in the technical property names of the feature schema -- that is what the queryables and presentables of an API are named after, and what the "properties" and "exclude-properties" parameters accept. The transformation chain renames properties: explicitly, through a configured rename, and implicitly through the alias renames injected for a format that encodes properties under their alias. Matching the selection after the chain therefore compared it against names that no longer existed, and every property whose name the chain had changed was pruned away. Only properties whose name survived the rename unchanged were left, so a selection could empty a response of its content without any error.
Prune before the chain, so the selection is matched against the names it is written in, and the renames then apply to what survived.
ProjectionBeforeRenameSpec locks the order in both directions: pruning first keeps the selected properties under their alias, pruning last keeps only the property the rename left alone.