-
-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduction of multiple swagger docs with new endpoint now versioned returns 404 #876
Comments
I encountered the same issue. I can't validate against more than one specification. Is this a potential bug, or are we using it incorrectly? Perhaps the 'apiSpec' could support an array of specifications, allowing the middleware function to be called just once? Thanks. Edit: Tested on v5.1.6 |
In my case, the problem seems to be when not using Here are steps to reproduce:Using the official example 2-standard-multiple-api-specs as is it works fine. But if we remove servers:
- url: /v2 and modify the path from: paths:
/pets: to: paths:
/v2/pets: causes 404 {
"message": "not found",
"errors": [
{
"path": "/v2/pets",
"message": "not found"
}
]
}
|
Describe the bug
A clear and concise description of what the bug is.
/hello-world/:name
/v2/hello-world/:name/:surname
/v2/hello-world/:name/:surname
is returning 404OpenApiValidator.middleware
has to be called incrementallyTo Reproduce
Steps to reproduce the behavior.
./swagger/v1.yaml
./swagger/v2.yaml
useRoutes.js
The routes are typical express route definitions:
Actual behavior
A clear and concise description of what happens.
GET http://localhost:3000/hello-world/Dan ✅ works as it did before
GET http://localhost:3000/v2/hello-world/Dan ❌ 404 response
If I don't register the unversioned route (
/hello-world/:name
), then the v2 route (/v2/hello-world/:name/:surname
) does work.Expected behavior
A clear and concise description of what you expected to happen.
I am expecting the unversioned route and the versioned route to both work
Examples and context
An example or relevant context e.g. an OpenAPI snippet, an Express handler function snippet
The text was updated successfully, but these errors were encountered: