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

Serialization of flatRate and isFlatRate are mixed up. #600

Closed
briansheppard-toast opened this issue Nov 3, 2022 · 3 comments
Closed

Serialization of flatRate and isFlatRate are mixed up. #600

briansheppard-toast opened this issue Nov 3, 2022 · 3 comments
Labels
to-evaluate Issue that has been received but not yet evaluated

Comments

@briansheppard-toast
Copy link

Describe the bug
When an object has properties named foo and isFoo then the serialization gets the properties and values mixed up.

Version information
2.12.7

To Reproduce
// Kotlin code:

data class FlatRateClass(val isFlatRate: Boolean, val flatRate: Double)
val testObject = FlatRateClass(true, 23.75)
val actual = jacksonObjectMapper().writeValueAsString(testObject)

Expected behavior
I would like actual to be {"isFlatRate":true,"flatRate":23.75}

But actual is {"isFlatRate":23.75}. This mixes the name of the boolean property with the value of the Double property.

Additional context
I tried a number of annotations, using JsonProperty and ignoring isGetter fields, but could not make any serialization that would round-trip from object to string and back.

@briansheppard-toast briansheppard-toast added the to-evaluate Issue that has been received but not yet evaluated label Nov 3, 2022
@cowtowncoder
Copy link
Member

Kotlin-specific, wrong repo, will transfer.

@cowtowncoder cowtowncoder transferred this issue from FasterXML/jackson-databind Nov 4, 2022
@briansheppard-toast
Copy link
Author

thanks

@k163377
Copy link
Contributor

k163377 commented Mar 3, 2023

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

@k163377 k163377 closed this as completed Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to-evaluate Issue that has been received but not yet evaluated
Projects
None yet
Development

No branches or pull requests

3 participants