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

Fix regression in Map deserialization in Scala 2.13 when default typing is enabled #658

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

retronym
Copy link
Contributor

@retronym retronym commented Dec 4, 2023

This Map serializer is implemented in terms of the Java version and is somewhat fragile, as discussed in #643 / #470.

This commit ensures that the wrapper class is a member class in both Scala and Java.

That results in this JSON as the serializer code chooses not to put the inner class name in the type annotation.

{"m":["scala.collection.immutable.Map",{"one":"one","two":"two"}]}

Fixes #643

@retronym retronym changed the title Fix regression in Map deserializtion in Scala 2.13 when default typing Fix regression in Map deserializtion in Scala 2.13 when default typing is enabled Dec 4, 2023
@retronym retronym force-pushed the bug/643 branch 2 times, most recently from d6be7f0 to 87de69c Compare December 4, 2023 04:03
This Map serializer is implemented in terms of the Java version and is
somewhat fragile, as discussed in FasterXML#643 / FasterXML#470.

This commit ensures that the wrapper class is a member class in both Scala and Java.

That results in this JSON as the serializer code chooses not to put
the inner class name in the type annotation.

```
{"m":["scala.collection.immutable.Map",{"one":"one","two":"two"}]}
```

Fixes FasterXML#643
Copy link
Member

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - thanks

@pjfanning pjfanning merged commit 407d743 into FasterXML:2.17 Dec 4, 2023
17 checks passed
pjfanning pushed a commit that referenced this pull request Dec 4, 2023
This Map serializer is implemented in terms of the Java version and is
somewhat fragile, as discussed in #643 / #470.

This commit ensures that the wrapper class is a member class in both Scala and Java.

That results in this JSON as the serializer code chooses not to put
the inner class name in the type annotation.

```
{"m":["scala.collection.immutable.Map",{"one":"one","two":"two"}]}
```

Fixes #643
@pjfanning
Copy link
Member

Thanks @retronym - I think this is safe to include in the 2.16.1 release, so I've backported it back to the 2.16 branch.

I'm surprised that the core jackson-databind writes the pre-conversion class name with this change but it obviously works based on your test case. The test case should help us spot if the core jackson-databind library modifies this behaviour.

@pjfanning pjfanning changed the title Fix regression in Map deserializtion in Scala 2.13 when default typing is enabled Fix regression in Map deserialization in Scala 2.13 when default typing is enabled Dec 4, 2023
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.

Failure to deserialise scala Map when default typing is activated
2 participants