FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Let generated code declare whether styled parameter values are escaped by mromaszewicz · Pull Request #143 · oapi-codegen/runtime · GitHub

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

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 requested a review from a team as a code owner July 12, 2026 22:18
mromaszewicz added the bug Something isn't working label Jul 12, 2026
mromaszewicz merged commit 324e57f into main Jul 12, 2026
23 checks passed
mromaszewicz deleted the fix/issue-35 branch July 12, 2026 22:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL