For example, with Jsonb we can obtain the specific type once and then write directly to the outputSteam like:
ctx.status(200).contentType("application/json");
var result = HelloDto.rob();
jsonTypeHelloDto.toJson(result, ctx.outputStream());
... where jsonTypeHelloDto is obtained like:
static final Jsonb jsonb = Jsonb.builder().build();
static final JsonType<HelloDto> jsonTypeHelloDto = jsonb.type(HelloDto.class);
With this approach, it effectively bypasses the underlying io.avaje.jex.spi.JsonService with the view that this can be more flexible and more efficient.
For example, with Jsonb we can obtain the specific type once and then write directly to the outputSteam like:
... where jsonTypeHelloDto is obtained like:
With this approach, it effectively bypasses the underlying io.avaje.jex.spi.JsonService with the view that this can be more flexible and more efficient.