Closed swcm-mnestler closed 2 years ago
Thanks for reporting this issue ... I will look into it and adjust the route registration order accordingly. Meanwhile you might circumvent the issue by setting the route order by hand with the @RouteOrder(number) annotation. It was not intended for this purpose but might do the trick.
I have hopefully fixed this / have not tested extensively but unit tests work just fine. Please report if you find additional problems.
Thank you very much, it seems to work flawlessly!
Description
Since vert.x 4.3 the order in which routes are registered is checked by
io.vertx.ext.web.impl.RouteState
. Usingrest.vertx
with vert.x 4.3 can lead to an error in specific circumstances:This can be circumvented by setting the
io.vertx.web.router.setup.lenient
property totrue
, but even then aWARNING
is logged.As far as I could tell, this issue occurs
User
) is present in the function parametersResolution suggestions
From a cursory glance, the "weight" of a handler is determined by its type. As such, a
PlatformHandler
should have the highest "priority". So a possible solution would be to mark the custom handlers that are registered before the body handler asimplements io.vertx.ext.web.handler.PlatformHandler
.If no marker interface is implemented, priority "USER" is assumed (lowest priority -> register last).
Steps to reproduce
Setup minimal vert.x app with a sample resource
Use vert.x 4.3+ and rest.vertx 1.1
Run app: