Skip to content

fix filters on a feature reference not matching any feature - #621

Merged
azahnen merged 2 commits into
masterfrom
feature-ref-queryable-id
Aug 25, 2026
Merged

fix filters on a feature reference not matching any feature#621
azahnen merged 2 commits into
masterfrom
feature-ref-queryable-id

Conversation

@cportele

Copy link
Copy Markdown
Contributor

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.

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.
@cportele
cportele requested a review from azahnen as a code owner August 25, 2026 10:56
@cportele cportele added the bug label Aug 25, 2026
@cportele cportele self-assigned this Aug 25, 2026
@azahnen
azahnen enabled auto-merge (squash) August 25, 2026 13:15
@azahnen
azahnen merged commit b4b6533 into master Aug 25, 2026
3 checks passed
@azahnen
azahnen deleted the feature-ref-queryable-id branch August 25, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants