question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 7 years ago
  • Reactions:30
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

20reactions
frost13itcommented, Jun 27, 2018

Implementation of this is necessary to use @JsonUnwrapped in Kotlin.

1reaction
cowtowncodercommented, Jun 19, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found