Skip to content

Conversation

kalafut
Copy link

@kalafut kalafut commented Aug 12, 2025

During testing of OpenAPI validations, I found unpredictable results when anything but simple ASCII characters were used. For example, maxLength and pattern constraints weren't working as expected. I traced this down to the way kin-openapi is setting up the mux, which leads to: https://github.com/gorilla/mux/blob/db9d1d0073d27a0a2d9a8c1bc52aa0af4374d265/regexp.go#L357-L359

router.FindRoute() returns escaped/%-encoded path parameters, which means validations are running against those instead of the actual string. I can't think of a good reason why that would be preferred, but I left it as the default behavior for backward compatibility.

If the user wants these parameters decoded, they can set DecodePathParams: true.

@kalafut kalafut requested a review from a team as a code owner August 12, 2025 21:16
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.

1 participant