-
-
Notifications
You must be signed in to change notification settings - Fork 91
Closed
Description
Hello,
I am trying to validate Prometheus API call against a OpenAPI.yaml and libopenapi. The validator reports query parameters with brackets in their names as missing, even when they are present in the request URL. This appears to be related to URL encoding where brackets are encoded as %5B (for [) and %5D (for ]).
If Define an OpenAPI spec with a query parameter that has brackets in its name:
parameters:
- name: match[]
in: query
required: true
explode: false
schema:
type: array
items:
type: stringThe validator should recognize match[] and match%5B%5D as equivalent (since %5B = [ and %5D = ] per RFC 3986) and validate successfully, but ir reports:
Error: Query parameter 'match[]' is missing
Reason: The query parameter 'match[]' is defined as being required, however it's missing from the requests
Note:
- When inspecting the request,
req.URL.Query()correctly parses it asmap[match[]:[up] start:[0] end:[100]] - The raw query string shows:
match%5B%5D=up&start=0&end=100(URL-encoded form) - The validator appears to be looking for the literal string
match[]in the URL rather than comparing against the decoded parameter name - Parameters without brackets validate correctly
Metadata
Metadata
Assignees
Labels
No labels