The JSON spec asks for whitespace after {, [ and before and after the value, but every JSON validator don't need whitespaces to consider a JSON valid and I've never seen a non-prettified JSON with whitespaces. It doesn't say they are optional, even though they clearly don't need to be there.