fix(filter)!: accept a property path on the right side of a comparison - #150
Merged
Merged
Conversation
pdevito3
force-pushed
the
fm/qk-breaking-right-side-path
branch
from
October 1, 2026 21:38
d0c89f8 to
4d42f5a
Compare
The right side of a comparison read one identifier. Title == Author.Name threw ParsingException, and the README examples with a path on the right side (Rating > Author.Score) did not work. Read a dotted property path on the right side, and resolve it like a path on the left side. An unquoted dotted name on the right side must resolve to a property. If it does not, the filter throws UnknownFilterPropertyException. A path through a collection also throws. The path obeys MaxPropertyDepth and PreventFilter. A property list does not accept a path on the right side. BREAKING CHANGE: Title == Author.Name compares the two properties. Title == foo.bar throws UnknownFilterPropertyException instead of ParsingException. Quote the text to compare with a literal value.
pdevito3
force-pushed
the
fm/qk-breaking-right-side-path
branch
from
October 3, 2026 12:08
4d42f5a to
53350f1
Compare
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.
Summary
UnknownFilterPropertyException.PropertyResolver.ResolveWithoutQueryName, so it obeysMaxPropertyDepthandPreventFilter.(Title, Directions) == ...) does not accept a path on the right side. The parse fails withParsingException, like before.v1.14.2 behavior (and main)
The right side reads one identifier. An unquoted dotted word on the right side throws
ParsingException. The README shows right-side paths (Email.Value == CollectionEmail.Value,Rating > Author.Score), but these examples throw.New behavior
RecipeTitle == Author.Namex => (x.Title == x.Author.Name)Title == Author.NmaeUnknownFilterPropertyException: "The filter property 'Nmae' was not recognized."Title == foo.barUnknownFilterPropertyExceptionforfooTitle == Ingredients.NameUnknownFilterPropertyExceptionforIngredients.Name(a path through a collection is not one value)Title == Author.NamewithMaxPropertyDepth = 0QueryKitPropertyDepthExceededExceptionTitle == Author.Name || Rating > 3withAuthor.Namepreventedx => (x.Rating > 3)Title == "foo.bar",Rating == 3.5Only identifier-shaped dotted text is a path. Numbers, dates, Guids, and quoted text keep their parsers, which run first. A single unquoted identifier that is not a property stays a value, as before. An unresolved path throws also when
AllowUnknownPropertiesis on, like an unknown property on the right side of arithmetic.Justification
The README documents property paths on the right side, and a path works on the left side. The right side must accept the same paths with the same checks. A typo in a path must not turn into a silent string comparison.
Migration
A filter that compared with an unquoted dotted word as text must quote it:
Title == "foo.bar".README
"Child Property Comparisons" now tells that an unquoted dotted name on the right side must resolve to a property, and how to quote a literal.
Tests
PropertyResolverTests.property_path_on_the_right_side_is_comparedunresolved_property_path_on_the_right_side_throws(Author.Nmae,foo.bar,Ingredients.Name) and..._when_unknown_properties_are_allowedproperty_path_on_the_right_side_obeys_max_property_depthprevented_property_path_on_the_right_side_removes_the_clauseproperty_path_on_the_right_side_of_a_property_list_throwsnumber_with_a_dot_on_the_right_side_is_a_value,quoted_value_with_a_dot_on_the_right_side_is_a_valueproperty_path_on_the_right_side_is_compared,prevented_property_path_on_the_right_side_is_not_compareddotnet test: 574 unit tests and 359 Postgres integration tests (Testcontainers) pass, 0 failures.Rebase on v2
The branch is rebased on v2, after #136, #154, and #141. The v2 tests that expected a throw for
Title == Author.NameandTitle == foo.barare replaced by the tests above.