Describe the bug
Hi, since the version 2.12.1 (don't have the problem in version 2.12.0), I have a problem to serialize a data class with this structure (see below).
I have see error :
Conflicting getter definitions for property "content": Export#getContent() vs Export#getContent-Type() com.fasterxml.jackson.databind.JsonMappingException: Conflicting getter definitions for property "content": Export#getContent() vs Export#getContent-Type() at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:288) at com.fasterxml.jackson.databind.SerializerProvider.reportMappingProblem(SerializerProvider.java:1308)
So I made some test and I if rename the attribut Content-Type without the "-" ("ContentType") or Content2-Type, I don't have any problem.
Why I have this problem ? The regression is that normal ? How can I fix that ? (without rename my attributes)
Thanks
To Reproduce
data class Export(val filename: String, val content: String, val `Content-Type`: Charset = Charsets.UTF_8)
fun main() {
val export = Export("test","contentvaleur")
jacksonObjectMapper().writeValueAsString(export)
}
Describe the bug Hi, since the version 2.12.1 (don't have the problem in version 2.12.0), I have a problem to serialize a data class with this structure (see below). I have see error :
Conflicting getter definitions for property "content": Export#getContent() vs Export#getContent-Type() com.fasterxml.jackson.databind.JsonMappingException: Conflicting getter definitions for property "content": Export#getContent() vs Export#getContent-Type() at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:288) at com.fasterxml.jackson.databind.SerializerProvider.reportMappingProblem(SerializerProvider.java:1308)
So I made some test and I if rename the attribut
Content-Type
without the "-" ("ContentType") orContent2-Type
, I don't have any problem. Why I have this problem ? The regression is that normal ? How can I fix that ? (without rename my attributes) ThanksTo Reproduce
Expected behavior {"filename":"...", "content":"...", "Content-Type":"..."}
Versions Kotlin:1.6.21 Jackson-module-kotlin: 2.12.1 Jackson-databind: 2.12.1