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

Use field names when serializing data classes #169

Closed
buremba opened this issue Jul 18, 2018 · 3 comments
Closed

Use field names when serializing data classes #169

buremba opened this issue Jul 18, 2018 · 3 comments

Comments

@buremba
Copy link

buremba commented Jul 18, 2018

When I try to serialize the following class:

data class TestClass (val isActive: Boolean)

Jackson returns:

{"active": true}

Kotlin might be creating getters for the attribute and probably Jackson picks the getters instead of fields but the behavior is unexpected since the getters are hidden in Kotlin so the following output might be much better in terms of consistency:

{"isActive": true}
@raderio
Copy link

raderio commented Aug 10, 2018

#80

@abhishek-rio
Copy link

I am also facing the same issue. Is it fixed or is there any work around?

@cowtowncoder
Copy link
Member

This was fixed in 2.10.1, issue #80. Problem is Kotlin's differing convention for naming "is properties".

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

No branches or pull requests

4 participants