vertx-web icon indicating copy to clipboard operation
vertx-web copied to clipboard

OpenAPI path matching must be in correct order

Open hradecek opened this issue 4 years ago • 2 comments

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)

hradecek avatar Nov 21 '20 21:11 hradecek

Can you rebase on latest master so I can merge it?

slinkydeveloper avatar Jan 12 '21 17:01 slinkydeveloper

Hey @hradecek any updates about this PR?

slinkydeveloper avatar May 24 '21 13:05 slinkydeveloper