Skip to content

fix(client): preserve literal commas in form/explode=false query params - #1

Merged
TelpeNight merged 1 commit into
TelpeNight:bug/2183-explode-commafrom
mromaszewicz:bug/2183-explode-comma
Mar 6, 2026
Merged

TelpeNight merged 1 commit into
TelpeNight:bug/2183-explode-commafrom
mromaszewicz:bug/2183-explode-comma

Conversation

@mromaszewicz

Copy link
Copy Markdown

Summary

Test plan

  • make test passes across all modules
  • make lint passes with 0 issues
  • make generate output is up-to-date
  • New test cases verify spec-conformant query strings

🤖 Generated with Claude Code

The generated client code was round-tripping styled query parameter
fragments through url.ParseQuery + url.Values.Encode(), which re-encoded
comma delimiters as %2C. Per the OpenAPI spec, form/explode=false arrays
should use literal commas as delimiters (e.g. color=blue,black,brown).

Change the client template to collect pre-encoded fragments from
StyleParamWithLocation and join them directly, bypassing the re-encoding.

Also moves the issue-2183 test to internal/test/issues/issue-2183/,
extends it with explode=true and multi-param cases, and documents the
remaining server-side limitation (oapi-codegen/runtime#91) for values
containing embedded commas.

Fixes oapi-codegen#2183

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@TelpeNight
TelpeNight merged commit 917dbdc into TelpeNight:bug/2183-explode-comma Mar 6, 2026
1 check passed
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.

2 participants