vertx-web
vertx-web copied to clipboard
OpenAPI path matching must be in correct order
Issue: https://github.com/vert-x3/vertx-web/issues/1751
Description: Open API paths/routes cannot be mounted/defined to router in order in which they are defined in OpenAPI specfile. They must be ordered from the most specific ones to the least specific (with the most path parameters).
Solution: Because by definition, two paths are equivalent /path/{param1} /path/{param2} order can be determined based on number of path's parameters.
So, when io.vertx.ext.web.Router is created, order of its routes is defined based on number of path parameters they have.
For example:
/pets/{param1} -> route.order(1)
/pets/{param1}/{param2} -> route.order(2)
/pets/mine -> route.order(0)
Can you rebase on latest master so I can merge it?
Hey @hradecek any updates about this PR?