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.

Add `@JsonWrapped`

See original GitHub issue

It would be nice to have the inverse of @JsonUnwrapped.

This would enable serializing this class:

class Gene {
  String symbol;
  String chrId;
  String chrName;
}

To this:

{
  "symbol" : "X",
  "chr" : { 
    "id" : "Y",
    "name": "chr1"
  }
}

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:11
  • Comments:26 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ISchwarz23commented, Mar 20, 2016

+1

1reaction
manishpatelUKcommented, Jan 30, 2016

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add @JsonWrapped (to complement @JsonUnwrapped) #42
I have a REST service producing unnecessary additional layers of abstraction that i would like to exclude from my Java POJOs rather than...
Read more >
More Jackson Annotations - Baeldung
The @JsonAppend annotation is used to add virtual properties to an object in addition to regular ones when that object is serialized.
Read more >
JsonUnwrapped (Jackson-annotations 2.9.0 API) - FasterXML
Annotation can only be added to properties, and not classes, as it is contextual. Also note that annotation only applies if. Value is...
Read more >
Force Jackson to add addional wrapping using annotations
I have created a small jackson module that contains a @JsonWrapped annotation, that solves the problem. See here for ...
Read more >
Using prefix and suffix attributes of @JsonUnwrapped to avoid ...
This tutorial shows how attributes @JsonUnwrapped#prefix and @JsonUnwrapped#suffix can be used to avoid name collision. Example. Java Object.
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