Is there a way to get JSONEncoder in Swift to format the output JSON more like normal JSON? It puts spaces to the left of “:” characters, and shows empty arrays with an empty line between the square brackets.

Or is there a drop-in replacement that gives more formatting control?