Skip to content

feat: add BindRawQueryParameter for correct comma handling#92

Open
mromaszewicz wants to merge 1 commit intooapi-codegen:mainfrom
mromaszewicz:fix/issue-91
Open

feat: add BindRawQueryParameter for correct comma handling#92
mromaszewicz wants to merge 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>
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

1 participant