Add `@JsonWrapped`
See original GitHub issueIt 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:
- Created 9 years ago
- Reactions:11
- Comments:26 (7 by maintainers)
Top 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 >
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 Free
Top 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
+1
+1