Skip to content

fix: differentiate explicitly empty string delimiter from "no delimiter" - #2295

Open
rmja wants to merge 4 commits into
reactiveui:mainfrom
rmja:fix-2294
Open

fix: differentiate explicitly empty string delimiter from "no delimiter"#2295
rmja wants to merge 4 commits into
reactiveui:mainfrom
rmja:fix-2294

Conversation

@rmja

@rmja rmja commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Fixes #2294.

What is the new behavior?

QueryFormData is default when no [Query] attribute is present, so Delimiter is null in that case — the IsNullOrEmpty guard was there for the absent case, but it swallows "" along with it. Now data.Delimiter ?? DefaultNestingDelimiter, with Delimiter retyped to string? so the absent case is expressed as null rather than leaning on emptiness. Three call sites: object query, CollectionFormat.Indexed collections, and path-residual queries.

What is the current behavior?

The source generated and reflection client generates different queries for empty string delimiters.

What might this PR break?

There should be none, as this pr fixes a mismatch between the reflection based client generation and source generated client.

Checklist

  • I have read the Contribute guide
  • Tests have been added or updated (for bug fixes / features)
  • Docs have been added or updated (for bug fixes / features)
  • Changes target the main branch
  • PR title follows Conventional Commits

Additional information

@rmja

rmja commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Worth flagging since it's a judgement call and not purely mechanical: this makes the fix touch a test that was written deliberately. The argument is parity — for the Indexed path the generator was the only one inserting the dot, and TryBuildIndexedCollectionModel requires data.CollectionFormatValue.HasValue, which requires a [Query] attribute, which always carries a non-null Delimiter. So the ?? DefaultNestingDelimiter fallback on that path is now purely defensive and unreachable in practice.

@rmja

rmja commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Great. It seems CI is finally happy. Let me know what you think!

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.

[Bug]: [Query(delimiter: "")] is ignored — nested query keys are always joined with .

1 participant