1

This question's answer (Convert JSON many objects to single JSON using Jackson) explains how to flatten JSON using Jackson, with @Attributes.

Is there a way to tell a Jackson ObjectMapper to recursively flatten all composite fields, without adding annotations? And if so, is there a way to specify that the field names be prefixed with the parent (containing) object's name?

My goal is to get a a Map out. I could write this as a recursive function, but if I can use Jackson, I'd like not to re-invent wheels.

theMayer
  • 15,456
  • 7
  • 58
  • 90
tpdi
  • 34,554
  • 11
  • 80
  • 120
  • Possible duplicate of [Flattening a 3 level nested JSON string in java](https://stackoverflow.com/questions/58008267/flattening-a-3-level-nested-json-string-in-java) – Michał Ziober Oct 21 '19 at 21:46

0 Answers0