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

Mangle constructor parameter names to preserve read-after-write #351

Closed
wants to merge 1 commit into from

Conversation

popiel
Copy link

@popiel popiel commented Jul 3, 2020

NOTE: This is a backport of pull request #350 to the 2.12 line.

Jackson with the Kotlin module does not choose the same json field names for both reading and writing if you have a data class with PascalCase field names, unless you go through a bunch of pain with @JsonProperty annotations. Not being able to read after write seems like a bug, so I fixed it.

Context: I'm working with a code generator that makes data classes based on DB schema. Because {reasons}, this makes classes with PascalCase field names, and it's not viable to change that to be more idiomatic for Kotlin.

@dinomite
Copy link
Member

dinomite commented Jan 1, 2021

Had trouble checking out this PR so I created a new PR with your changes.

@dinomite dinomite closed this Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants