Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression since 2.12.1 if class has attributes with names xxx and xxx-yyy - Error :Conflicting getter definitions for property #678

Closed
drapej opened this issue May 16, 2023 · 1 comment
Labels

Comments

@drapej
Copy link

drapej commented May 16, 2023

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)
}

Expected behavior
{"filename":"...", "content":"...", "Content-Type":"..."}

Versions
Kotlin:1.6.21
Jackson-module-kotlin: 2.12.1
Jackson-databind: 2.12.1

@drapej drapej added the bug label May 16, 2023
@drapej drapej changed the title Regression since 2.12.1 if class have attributes with names xxx and xxx-yyy : Conflicting getter definitions for property Regression since 2.12.1 if class has attributes with names xxx and xxx-yyy - Error :Conflicting getter definitions for property May 16, 2023
@k163377
Copy link
Contributor

k163377 commented May 19, 2023

This issue will be fixed by #630 and therefore closed as a duplicate.

@k163377 k163377 closed this as completed May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants