Skip to content

feat: add BindRawQueryParameter for correct comma handling#92

Merged
mromaszewicz merged 1 commit intooapi-codegen:mainfrom
mromaszewicz:fix/issue-91
Feb 26, 2026
Merged

feat: add BindRawQueryParameter for correct comma handling#92
mromaszewicz merged 1 commit intooapi-codegen:mainfrom
mromaszewicz:fix/issue-91

Conversation

@mromaszewicz
Copy link
Member

Add BindRawQueryParameter which operates on the raw (undecoded) query string instead of pre-parsed url.Values. For form/explode=false parameters, this splits on literal commas before URL-decoding each part, correctly preserving %2C as a literal comma in values.

Also adds findRawQueryParam internal helper, comprehensive tests, and round-trip (serialize/deserialize) tests.

Deprecates BindQueryParameter, which cannot distinguish delimiter commas from literal commas because url.Values pre-decodes %2C.

Fixes #91

Note: oapi-codegen/oapi-codegen will need to update its generated code to call BindRawQueryParameter (passing r.URL.RawQuery) once this change is released.

Add BindRawQueryParameter which operates on the raw (undecoded) query
string instead of pre-parsed url.Values. For form/explode=false
parameters, this splits on literal commas before URL-decoding each part,
correctly preserving %2C as a literal comma in values.

Also adds findRawQueryParam internal helper, comprehensive tests, and
round-trip (serialize/deserialize) tests.

Deprecates BindQueryParameter, which cannot distinguish delimiter commas
from literal commas because url.Values pre-decodes %2C.

Fixes oapi-codegen#91

Note: oapi-codegen/oapi-codegen will need to update its generated code
to call BindRawQueryParameter (passing r.URL.RawQuery) once this change
is released.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mromaszewicz mromaszewicz merged commit 1f844c3 into oapi-codegen:main Feb 26, 2026
14 checks passed
@mromaszewicz mromaszewicz deleted the fix/issue-91 branch February 26, 2026 14:55
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.

BindQueryParameter cannot distinguish delimiter commas from literal commas in form/explode=false values

2 participants