Skip to content

Regression with custom @JsonUnwrapped deserializer from 3.0 to 3.1 #6001

Description

@kistlers

Search before asking

  • I searched in the issues and found nothing similar.

Describe the bug

@JsonUnwrapped on Java record components behaves differently between Jackson databind 3.0.x and 3.1.x when the unwrapped value uses a custom ValueDeserializer that implements unwrappingDeserializer(...).

With Jackson databind 3.0.x, the custom unwrapping deserializer receives the expected flattened JSON fields.

With Jackson databind 3.1.x, the custom unwrapping deserializer is still invoked and receives the correct NameTransformer, but the JsonParser content passed to deserialize(...) is an empty object {}. As a result, the unwrapped value cannot be deserialized.

More context is in the reproducer repo: https://github.com/kistlers/jackson-3-unwrapped-regression/blob/main/README.md

Multiple changes were released with 3.1 that relate to JsonUnwrapped, but I cannot se what exactly relates to my issue:

Version Information

3.1.3

Reproduction

I created a full reproducer repo:
https://github.com/kistlers/jackson-3-unwrapped-regression

The Readme describes the full steps of reproduction and a test that works in 3.0.4 and fails in 3.1.3

Expected behavior

This behaviour should still work in 3.1

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions