Support `@JsonUnwrapped` with `@JsonCreator` (if possible)
See original GitHub issue(note: follow-up for #265)
Current implementation of @JsonUnwrapped
deserialization requires handling of all other properties first, and only then reconstructing unwrapped objects. This works ok via fields/setters, but can not work with @JsonCreator
passed values.
But with a major rewrite it should be possible to make this work. This probably requires more support for actually determining unwrapped-properties a priori, instead of just buffering anything that doesn’t match. Or maybe it only requires more logic in handling of creator.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:30
- Comments:17 (4 by maintainers)
Top Results From Across the Web
Deserializing @JsonUnwrapped fields with @JsonCreator ...
What is the correct way of defining the Place constructor? If I use: @JsonCreator public Place(@JsonProperty("name") String name, @JsonProperty( ...
Read more >JsonUnwrapped and @JsonCreate for same field causes issues
When I use @JsonUnwrapped on nested field: public class Person{ private int id; @JsonUnwrapped private Father father //getters/setters @Data ...
Read more >Supported Frameworks (JAX-RS, Jackson and more) - Miredot
On this page you can find overview of annotations supported by Miredot. Most JAX-RS, Spring MVC and Jackson annotations are fully supported.
Read more >Security update for jackson-databind, jackson-dataformats ...
An update that fixes three vulnerabilities is now available. ... declaration + Support 'suppressed' property when deserializing 'Throwable' ...
Read more >Micronaut Serialization
The full list of supported Jackson annotations and members is described in the table below. If an unsupported annotation or member is used,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Implementation of this is necessary to use
@JsonUnwrapped
in Kotlin.@OverlyExcessive It works just fine with deserialization if you use setters (or fields). Note that you do NOT have to pass ALL properties via creator; mixing and matching creator and setters/fields is legal.
This is not to say it wouldn’t be great to allow passing unwrapped properties via Creator methods, just that this is the one aspect with unwrapped properties that does not work.