Open
Description
Hello,
For a simple spec like this one:
/resource/{param}:
get:
operationId: getMaxLengthResourceParameter
parameters:
- name: param
in: path
required: true
schema:
type: string
maxLength: 1
responses:
"204":
description: success
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.
Metadata
Metadata
Assignees
Labels
No labels