Skip to content

fix(filter): read a list for the in operators on a HasConversion<string> property - #220

Merged
pdevito3 merged 2 commits into
mainfrom
fix/in-operator-has-conversion
Nov 2, 2026
Merged

pdevito3 merged 2 commits into
mainfrom
fix/in-operator-has-conversion

Conversation

@pdevito3

@pdevito3 pdevito3 commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Why

The in operators ^^ and !^^ threw QueryKitParsingException on a property that is configured with HasConversion<string>(). QueryKit sent the list to the single-value (string) constructor path. Now QueryKit converts each list item with the (string) constructor.

Closes #217

What changed

  • For an in-operator list on a HasConversion<string>() property, QueryKit now builds an array of constants. It uses the same list check, item split, and value conversion as other types.
  • A list item that does not convert throws ParsingException with the value, the property name, and the type.

Scope

Tradeoffs

This replaces #218. That PR built its own bracket check and its own item parsing. As a result, Email == "[a]" failed, edge quotes were removed from list items, and "null" became a null.

Blast Radius

The change runs only for a list on a HasConversion<string>() property with a (string) constructor. Before, that input always threw. With other operators, a value in brackets, such as Email == [a] or Email == "[a]", is still one value, and a test guards it.

Verification

…<string>

The tests read a list with ^^ and !^^ on a struct, a nullable struct, and a
reference type that has a (string) constructor. They fail with the
QueryKitParsingException from #217.
…ng> property

A list such as Id ^^ ["2","3"] went to the single-value (string)
constructor path, so ^^ and !^^ threw QueryKitParsingException. Now each
list item goes through the (string) constructor and the right side is an
array of constants. A list item that does not convert throws
ParsingException with the value and the property name.

Fixes #217
@pdevito3

pdevito3 commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Review gate note. One low finding stays open: ^^* and !^^* are case-sensitive on a HasConversion<string>() property. The case-insensitive path runs only when the property type is string. ==* on main has the same limit for one value, so this PR does not add it. The other low finding (an unquoted [...] with == threw) is fixed with the op.TakesList() guard and a test.

@pdevito3
pdevito3 merged commit 0078151 into main Nov 2, 2026
2 checks passed
@pdevito3
pdevito3 deleted the fix/in-operator-has-conversion branch November 2, 2026 22:38
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.

The in operator (^^, !^^) does not work on a property with HasConversion<string>

1 participant