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.

Opposite implementation of @JsonUnwrapped

See original GitHub issue

Serializing object of the following class yeilds string like

public class User implements Serializable{

private Integer id;
private String name;
private Integer pinCode;
private String city;

// getters /setters

}

{“id”:1,“name”:“XYZ”,“pinCode”:123456,“city”:“ABC”} But we want that attributes pinCode and city should be a part of new Json node say address node.

So my expectation of the result is:

{ “id”: 1, “name”: “XYZ”, “address”: { “pinCode”: 123456, “city”: “ABC” } } Can this be accomplished without re-organizing the class structure and by using Json annotations

on the exact opposite lines of @JsonUnwrapped

http://stackoverflow.com/questions/37724834/jackson-serialize-and-wrap-attributes-into-a-new-object

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cowtowncodercommented, Feb 1, 2021

I’ll unlock the other issue hoping users will add reactions – it works well enough for “voting” purpose here, and I’ll delete +1s if any.

0reactions
cowtowncodercommented, Feb 1, 2021

@andredasilvapinto I don’t track it regularly, but I sometimes go through lists of open issues. It’s not a prime signal in general, but sort of “better than nothing”, and is something users can do to indicate their preference.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - What's the Jackson deserialization equivalent of ...
Are you certain @JsonUnwrapped is working for deserialization? I just tried it and am getting Could not read JSON: Unrecognized field... errors ...
Read more >
Guide to Jackson Annotations | Novixys Software Dev Blog
Introduction. Jackson provides a number of annotations which help tweak various facets of JSON serialization and deserialization.
Read more >
Jackson Annotations For Java Application - GeeksforGeeks
Java has immense application in the coding world, and almost all of us ... public class UnwrappedUser { public int id; @JsonUnwrapped public ......
Read more >
FasterXML - Bountysource
@JsonUnwrapped allows people who want a more compressed JSON hierarchy than their POJO to affect the process, but there is no option for...
Read more >
Deserializing @JsonUnwrapped fields with @JsonCreator ...
class Place { public final String name; @JsonUnwrapped public final ... implementation limitation and not hard limit, of course, but
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