-
Notifications
You must be signed in to change notification settings - Fork 306
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
Overwriting String Mapper #211
Comments
Just off the top of my head, and depending on how many responses and/or fields this would actually affect, I personally would take either of the following approaches:
|
@aurae Thanks for your time and for the info
That's the first thing that came to my mind as well. What I don't like is that this is pretty error prone as missing one single
I can't find any documentation on this other then the java-doc stating:
When I understand this correctly, it is called AFTEr the whole class was parsed. I think this is not working because setting null explicitly to a non-optional field raises an exception.
This is really what I am trying to avoid in the first place |
I currently try to map JSON responses to Kotlin data classes.
Now I am trying to parse some JSON responses with explicit
null
values for strings that are empty (rather then providing them as""
).I wonder how to get around this? Keeping in mind how String is implemented internally I would consider
""
as the default String value even if it is explicitly set tonull
.Now the question:
What would be the cleanest way to achieve this?
Do I have to change the String Mapper?
The text was updated successfully, but these errors were encountered: