Module io.jooby.jackson
module io.jooby.jackson
JSON module using Jackson: https://jooby.io/modules/jackson2.
Usage:
{
install(new Jackson2Module());
get("/", ctx -> {
MyObject myObject = ...;
// send json
return myObject;
});
post("/", ctx -> {
// read json
MyObject myObject = ctx.body(MyObject.class);
// send json
return myObject;
});
}
For body decoding the client must specify the Content-Type header set to
application/json.
You can retrieve the ObjectMapper via require call:
{
ObjectMapper mapper = require(ObjectMapper.class);
}
Complete documentation is available at: https://jooby.io/modules/jackson2.- Since:
- 2.0.0
- Author:
- edgar
-
Packages
Exports