I use Jackson to create a JSON file which I forward to a foreign REST service. It took me some hours to find out that that service is very sensitive to how the JSON file is formatted.
This is accepted:
[
{
"email": "foo.bar1@domain.com"
},
{
"email": "foo.bar2@domain.com"
}
]
This (and this is the default behavior of the Jackson pretty printer) is not accepted and causes the REST call to fail:
[ {
"email": "foo.bar1@domain.com"
}, {
"email": "foo.bar2@domain.com"
} ]
Can I configure Jackson to use the other format ? Let me stress this: I know that the author of the receiving REST service should fix this but this is out of my range.
There are questions in the field of custom Pretty Printers for Jackson like this one. But perhaps there is a custom made already.