You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and an HTTP request to /resource/%2B, the validation fails, although it should not. It fails because parameters are given in their encoded form to openapi3filter. In this case, it passes %2B for validation, and because it is longer than 1, it fails.
It should pass + to openapi3filter.
This is because route, pathParams, err := router.FindRoute(req) returns encoded pathParams. It does so because gorillamux.NewRouter(swagger) uses mux.NewRouter().UseEncodedPath() itself.
I am working on a PR fixing this.
The text was updated successfully, but these errors were encountered:
florentchauveau
added a commit
to florentchauveau/echo-middleware
that referenced
this issue
Apr 7, 2024
Parameters should be unscaped before being sent for validation.
gorillamux returns escaped parameters, but openapi3filter expects
unescaped parameters.
Parameters should be unscaped before being sent for validation.
gorillamux returns escaped parameters, but openapi3filter expects
unescaped parameters.
Hello,
For a simple spec like this one:
and an HTTP request to
/resource/%2B
, the validation fails, although it should not. It fails because parameters are given in their encoded form toopenapi3filter
. In this case, it passes%2B
for validation, and because it is longer than1
, it fails.It should pass
+
toopenapi3filter
.This is because
route, pathParams, err := router.FindRoute(req)
returns encodedpathParams
. It does so becausegorillamux.NewRouter(swagger)
usesmux.NewRouter().UseEncodedPath()
itself.I am working on a PR fixing this.
The text was updated successfully, but these errors were encountered: