Hi guys, I'm using Ktor as a server, for contentNe...
# ktor
j
Hi guys, I'm using Ktor as a server, for contentNegotiation I'm using jackson and I was wondering how can we add custom ContentType to make jackson accept for example
application/vnd.api+json
that in the end is also Json ? My current settings for ContentNegotiation
Copy code
install(ContentNegotiation) {
    jackson {
        enable(SerializationFeature.INDENT_OUTPUT)
        disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
        registerKotlinModule()
    }
}
t
Try this:
Copy code
val type = ContentType("application", "vnd.api+json")

install(ContentNegotiation) {
    register(type, JacksonConnverter())
    jackson {
        enable(SerializationFeature.INDENT_OUTPUT)
        disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
        registerKotlinModule()
    }
}
j
Thanks it works like a charm
🎉 1