Skip to content

Fix FromQuery(Name) with dots generating invalid C# variables#2354

Merged
jeremydmiller merged 1 commit intomainfrom
fix/from-query-name-codegen-2352
Mar 25, 2026
Merged

Fix FromQuery(Name) with dots generating invalid C# variables#2354
jeremydmiller merged 1 commit intomainfrom
fix/from-query-name-codegen-2352

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

  • Fixes FromQuery with Name property doesn't use parameter name in code gen #2352: When [FromQuery(Name = "hub.mode")] is used, the code generator was using the dotted name as the C# variable name (e.g., var hub.mode = ...), which fails to compile
  • Added dot (.) sanitization to SanitizeFormNameForVariable so dotted query string names produce valid C# identifiers (e.g., hub_mode)
  • Also fixed the Pulsar docker image tag (4.04.0.3) since the 4.0 tag doesn't exist

Test plan

  • Added Bug_2352_fromquery_name_with_dots test with dotted string and int query parameters
  • Verified the new test fails before the fix and passes after
  • All 537 Wolverine.Http.Tests pass (0 failures, 10 skipped)

🤖 Generated with Claude Code

…names

When using [FromQuery(Name = "hub.mode")] on a parameter, the code
generator used the dotted name as the C# variable name (e.g., var hub.mode),
which fails to compile. Added dot sanitization to SanitizeFormNameForVariable
so dotted query string names produce valid C# identifiers (e.g., hub_mode).

Closes #2352

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

FromQuery with Name property doesn't use parameter name in code gen

1 participant