-
Notifications
You must be signed in to change notification settings - Fork 174
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
Strange serialization property name internal
#607
Comments
@entrery Please include relevant class definition(s) instead of verbal explanation of the same. |
Apologies @cowtowncoder I thought it is a simple issue on my side. I deep dived a bit more into the issue. It turns out the strange behaviour is caused by the internal keyword in Kotlin. Here is a simple definition of a class and the json output:
Actual Output:
Expected Output:
Any hint is appreciated, thanks! |
Ok I don't know enough about Kotlin or this module to know but I hope someone else can help more. My only guess is that somehow Polymorphic deserialization was enabled for value class, using "as-wrapper-object" style -- output looks like that, so that key is simple class name of an inner class. But your declaration does not use |
Hi @cowtowncoder, First thanks for your reply. I continued with the investigation... It turned out you were already involved in a discussion about this issue in 2017. Here is the thread #71. I don't understand at all what the guys are talking about there because I am new to Kotlin but tomorrow when I weak up I will read it carefully :). You can also have a look and give me a hint if the provided solution at the end seems ok. Thanks! |
internal
Oh. :) I had fogotten about this. Work-arounds suggested may work but aren't really the proper solution. |
Hi experts,
I am new to Kotlin and I am trying to use Jackson for a simple (de)serialization scenario of a Kotlin class with the Jackson Kotlin module. However when I serialize the object I see a strange property pattern for the high-level object. For example if my class is called Account and it has a property transactions instead of "transactions:[]" in the json output I see transactions$":[]. Why is that ? I presume it is pretty straightforward to answer. Thanks in advance!
The text was updated successfully, but these errors were encountered: