JSON support using Jackson

Estimated reading time: 1 minute

The Jackson feature allows you to handle JSON content in your application easily using the jackson library.

This feature is a ContentNegotiation converter.

This feature is defined in the class io.ktor.jackson.JacksonConverter in the artifact io.ktor:ktor-jackson:$ktor_version.

Basic usage

To install the feature by registering a JSON content conversor using Jackson:

install(ContentNegotiation) {
    jackson {
        // Configure Jackson's ObjectMapper here

The jackson block is a convenient method for:

register(ContentType.Application.Json, JacksonConverter(ObjectMapper().apply {
    // ...


Inside the jackson block, you have access to the ObjectMapper used to install the ContentNegotiation. To give you an idea of what is available:

install(ContentNegotiation) {
    jackson {
        this.dateFormat = DateFormat.getDateInstance()
        this.convertValue(..., ...)