Skip to content
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

Handlers are generated in the wrong order #14

Open
la55u opened this issue Oct 12, 2022 · 1 comment
Open

Handlers are generated in the wrong order #14

la55u opened this issue Oct 12, 2022 · 1 comment

Comments

@la55u
Copy link

la55u commented Oct 12, 2022

Due to the inner workings of MSW, handlers must be defined in a certain order to avoid ambiguous paths. See more here. In short handlers with path parameters must be listed after handlers with static paths otherwise they will match to wrong path. A way to solve it would be to sort the handlers array by path.
Thank you for the lib!

@zoubingwu
Copy link
Owner

@la55u how do you maintain your openapi spec? what kind of tool you use to generate the openapi json/yaml file? I think you can sort them by paths when you generate the input file so you don't have to worry about this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants