What we do is use Jax-RS from within a Vertx-based application (with all the endpoints being asynchronous) using resteasy.
It's not very Vertxy, but it works and provides Swagger support.
Once you are beyond the first Jax-RS method you can be back in the world of Vertx, so we end up with things like this:
@GET
@Path("/getsomething")
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Get something")
@ApiResponse(
responseCode = "200"
, description = "Something that has been got."
, content = @Content(
mediaType = "application/json"
, schema = @Schema(implementation = Something.class)
)
)
public void getSomething(
@Suspended final AsyncResponse asyncResponse
, @Context Vertx vertx
, @QueryParam("arg") String argument
) {
getSomethingUsingVertx
.onFailure(ex -> asyncResponse.resume(
Response
.serverError()
.entity(ex.getMessage()) // You don't really want to return raw exception messages to clients
.build()
))
.onSuccess(result -> asyncResponse.resume(result));
}
This Jax-RS has void return type and the AsyncResponse is untyped so the Swagger processor needs to be told the data type that it's going to return.
Jim