-
Notifications
You must be signed in to change notification settings - Fork 81
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
Bug in routing #110
Comments
This module uses the Are you saying that calling |
I think the issue is the order in which they registered in react router, so if in the spec you define I know those routes are probably just an example, but if you follow more closely to REST standards, you shouldn't have this issue: paths:
/users: (post: createUser, get: queryUsers)
/users/{id}: (get: findOne, put: update, delete: removeUser) @slinkydeveloper Have you tried reordering your paths to make the |
Resolved reordering the paths. But i think that when paths are added in swaggerize-express, paths without regex must be added before paths with regex, to avoid this issue. As I said, IMHO api specification must be indipendent from implementation |
@tlivings sorry typing error i updated the issue description |
I've got the swagger spec like this:
The paths are defined in this order. After the implementation of handlers, if i try to call the path
/users/findUser
it will execute the handler for path/users/{query}
.I know that usually in an express application if i define a path with path parameter before another path without path parameter express will execute the handler of path with path parameter, but in this case swagger specs doesn't have to be depending to implementation.
Thank you
The text was updated successfully, but these errors were encountered: