I am using Jackson and would like to print JSON nicely so that each element of the arrays falls into each line, for example:
{
"foo": "bar",
"blah": [
1,
2
3
]
}
Setting SerializationFeature.INDENT_OUTPUT true only inserts newlines for the fields of the object, not the elements of the array, instead prints the object as follows:
{
"foo": "bar",
"blah": [1, 2, 3]
}
Does anyone know how to achieve this? Thanks!
lyomi source share