Skip to content

Let generated code declare whether styled parameter values are escaped#143

Merged
mromaszewicz merged 1 commit into
mainfrom
fix/issue-35
Jul 12, 2026
Merged

Let generated code declare whether styled parameter values are escaped#143
mromaszewicz merged 1 commit into
mainfrom
fix/issue-35

Conversation

@mromaszewicz

Copy link
Copy Markdown
Member

Closes: #35

BindStyledParameterWithOptions unconditionally unescaped values by parameter location, but routers differ in whether they deliver path parameters raw or already decoded. For frameworks that decode (e.g. Echo), this double-decoded values containing literal percent signs: "discount%20" arrived as "discount " and "15%off" failed binding entirely.

BindStyledParameterOptions gains ValueIsUnescaped: when true, the value has already been decoded (typically by the router) and binds verbatim. The zero value preserves the historical unescape-by-location behavior, so all existing callers — including the deprecated BindStyledParameter and BindStyledParameterWithLocation entry points and current generated code — are unaffected. Generated server wrappers will set the flag to match what their framework actually delivers, tracked in oapi-codegen/oapi-codegen#2455.

Closes: #35

BindStyledParameterWithOptions unconditionally unescaped values by
parameter location, but routers differ in whether they deliver path
parameters raw or already decoded. For frameworks that decode (e.g.
Echo), this double-decoded values containing literal percent signs:
"discount%20" arrived as "discount " and "15%off" failed binding
entirely.

BindStyledParameterOptions gains ValueIsUnescaped: when true, the value
has already been decoded (typically by the router) and binds verbatim.
The zero value preserves the historical unescape-by-location behavior,
so all existing callers — including the deprecated BindStyledParameter
and BindStyledParameterWithLocation entry points and current generated
code — are unaffected. Generated server wrappers will set the flag to
match what their framework actually delivers, tracked in
oapi-codegen/oapi-codegen#2455.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mromaszewicz mromaszewicz requested a review from a team as a code owner July 12, 2026 22:18
@mromaszewicz mromaszewicz added the bug Something isn't working label Jul 12, 2026
@mromaszewicz mromaszewicz merged commit 324e57f into main Jul 12, 2026
23 checks passed
@mromaszewicz mromaszewicz deleted the fix/issue-35 branch July 12, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BindStyledParameterWithOptions double-decodes path parameters

1 participant