Open cbornet opened 3 years ago
Paths in OpenAPI definitions are not supposed to include fragments at all. See https://github.com/OAI/OpenAPI-Specification/issues/1635, specifically this comment that references RFC 8820 section 2.5:
other Specifications MUST NOT define structure within the fragment identifier, unless they are explicitly defining one for reuse by media types in their definitions (for example, as JSON Pointer [RFC6901] does).
I know. Yet a lot of people use this technique as a workaround. See https://github.com/OAI/OpenAPI-Specification/issues/182 for instance. It seems swagger-ui could support it at little cost.
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
If a path contains a fragment, the query params are appended after the fragment. Clients (browser, curl, ...) don't send what is after the fragment so the query params are not sent. When building the URL for the request, the fragment should be searched and removed.
To reproduce...
Steps to reproduce the behavior:
Expected behavior
A request to /pet/findByStatus?status=available is made.
Additional context or thoughts
Using a fragment is a common workaround for the impossibility to have multiple operations on the same path+method.