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

An empty object should be deserialized as *the* Unit instance for a nullable Unit reference Type. #518

Open
schmist opened this issue Nov 13, 2021 · 0 comments
Labels

Comments

@schmist
Copy link
Contributor

schmist commented Nov 13, 2021

Describe the bug
Deserializing an empty object {} with reference Type Unit? leads to a new instance of kotlin.Unit instead of the singleton kotlin.Unit instance.

To Reproduce
assertSame(jacksonObjectMapper().readValue<Unit?>("{}"), Unit) or see submitted PR #519 with failing test.

Expected behavior
Deserialization to the kotlin.Unit singleton.

Versions
Kotlin: 1.5.31
Jackson-module-kotlin: 2.13.0
Jackson-databind: 2.13.0

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant