Skip to content

fix property selection dropping every renamed property - #597

Open
cportele wants to merge 1 commit into
masterfrom
fix-projection-before-rename
Open

fix property selection dropping every renamed property#597
cportele wants to merge 1 commit into
masterfrom
fix-projection-before-rename

Conversation

@cportele

@cportele cportele commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@cportele
cportele requested a review from azahnen as a code owner August 8, 2026 13:22
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.

Projections: properties/exclude-properties does not consider useAlias

1 participant