I am wondering how I can configure kotlinx as a default serialization in Spring Boot app.
For Jackson, I would use e.g. spring.jackson.deserialization.fail-on-unknown-properties=false
But I haven't found any configuration options for kotlinx in Spring.
I know kotlinx supports this, I only cannot find a way to configure it on Spring level so that it works for example in controller method signatures:
@PostMapping("/foo")
fun fooMethod(
@RequestBody fooJsonRequest: SomeDataClassRepresentingTheJson,
) {}
↑ Throws HttpMessageNotReadableException
exception suggesting I use ignoreUnknownKeys=true
when constructing kotlinx.serialization.json.Json
. However I do not know where to do this so it would apply to Spring itself.
I have tried creating a bean providing Json object to no avail.