unbox
value class
in Map key
when serializing
#470
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a continuation of #468, and a fix for #469.
This change will also cause
unboxing
whenvalue class
is set askey
.The tests now reflect this as well.
Repletion
About the behavior when
WrapperClass
is set tokey
#468 described a pattern that would
unbox
thevalue class
field when theWrapperClass
was set tokey
.On the other hand, this appeared to be a behavior that improperly overrides the
toString
method of theWrapperClass
, so it has been removed.Fixed
NullValueSerializer
being ignored whenunbox
result isnull
In the previous PR, there was a problem that
null
was written ignoring theNullValueSerializer
when the result ofunbox
wasnull
.Test cases have been added as well.
Question
The
JSON string
output bywriterWithDefaultPrettyPrinter
respects the newline code of the platform, but theKotlin raw string
always seems to use\n
.This is why the
Github464
test is failing on myWindows
environment.How should I fix this problem?
I believe that replacing
\r\n
with\n
for both output results would superficially solve the problem, but I'm wondering if there is a better fix.