-
Notifications
You must be signed in to change notification settings - Fork 5
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
Wrong path template matching #7
Comments
@vanta , openapi-first does not have it's own routing mechanisms. It depends solely on the web app framework used in the application, which in your case probably is express. In express, the order of the routes applied to the app/router is important because it follows 'first come, first served' rule. openapi-first iterates over your OAS 3.0 specification and for each operation (in order they appear in spec) it applies all declared openapi middlewares to the web app framework instance you use, using express-like route methods (i.e. So, in your case, it won't work if you specify operation in following order:
but it will work for this order:
Please let me know if this explanation resolves your issue. |
@vanta I think I finally understood what the problem is. I did not realise it before because I was focused on |
Wow, @kiebzak thanks for the update :) |
According to OpenAPI spec (https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#pathsObject) there is a possibility to have two endpoints like below:
and one without template (
/mine
) should match when requesting/pets/mine
. Currently in OAF it is not the case.The text was updated successfully, but these errors were encountered: