Skip to content

Conversation

@mromaszewicz
Copy link
Member

gorillamux uses UseEncodedPath(), so FindRoute() returns path parameters in percent-encoded form. openapi3filter expects decoded values, which causes validation of constraints like maxLength and pattern to fail on encoded input (e.g. %2B is 3 chars but decodes to 1 char).

Unescape path parameters after route matching and before passing them to openapi3filter.

Fixes #17
Supersedes #18

gorillamux uses UseEncodedPath(), so FindRoute() returns path parameters
in percent-encoded form. openapi3filter expects decoded values, which
causes validation of constraints like maxLength and pattern to fail on
encoded input (e.g. %2B is 3 chars but decodes to 1 char).

Unescape path parameters after route matching and before passing them
to openapi3filter.

Fixes oapi-codegen#17
Supersedes oapi-codegen#18

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mromaszewicz mromaszewicz requested a review from a team as a code owner February 7, 2026 18:22
@mromaszewicz mromaszewicz merged commit b5a3ece into oapi-codegen:main Feb 7, 2026
26 checks 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.

Path parameters are not validated properly when they are encoded

2 participants