I want to minimize my JSON being produced by the java Jackson (de)serializer. It is being read only in java.
I know, I can use mapper.enable(SerializationFeature.INDENT_OUTPUT)
to enable or disable debug indentation, making my JSON more human readable. But can I also (safely) avoid spaces, to strip my JSON?
E.g. in most 'human readable format it is:
{
"a": "b",
"c": "d"
}
Without indentation it is:
{ "a": "b", "c": "d" }
But I do want to achieve is:
{"a":"b","c":"d"}
How can I strip these spaces and is it safe at all? Thanks!