fix filters on a feature reference not matching any feature - #621
Merged
Conversation
A queryable for a feature reference is filtered against the id property of the reference. That only worked as long as none of the properties of the reference was mapped through a sub-decoder. MappingRulesDeriver synthesizes a rule for the container of a value whose parent has no rule yet, and derived the target of that rule from the target of the value. For a sub-decoder column that is wrong: the column is not a property of the target schema, it is the container of the values that the following rules address, so its target has to be the root target. At the root that was the case by accident, because the target of a top-level value has no parent. Inside an object the container inherited the target of the object, the object was registered as a value, and it shadowed the id of the reference. The filter was then resolved against a member of the sub-decoder document named after the reference, which never exists. - MappingRule.endsWithConnector tells a sub-decoder column from a join, MappingRulesDeriver uses it for the target of the container. - SqlMappingDeriver registers only values as value targets, so an object can no longer shadow a value with the same target. - The properties of a sub-decoder column are resolved from the schema the table is mapped from instead of from the root schema, so values in the sub-decoder document of a joined table are mapped, too. Their path in the document is now always recorded, it cannot be derived from the property name, e.g. the title of a feature reference may be mapped to any member.
azahnen
approved these changes
Aug 25, 2026
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.
A queryable for a feature reference is filtered against the id property of the reference. That only worked as long as none of the properties of the reference was mapped through a sub-decoder.
MappingRulesDeriver synthesizes a rule for the container of a value whose parent has no rule yet, and derived the target of that rule from the target of the value. For a sub-decoder column that is wrong: the column is not a property of the target schema, it is the container of the values that the following rules address, so its target has to be the root target. At the root that was the case by accident, because the target of a top-level value has no parent. Inside an object the container inherited the target of the object, the object was registered as a value, and it shadowed the id of the reference. The filter was then resolved against a member of the sub-decoder document named after the reference, which never exists.