Description
Motivation
When debugging an issue with a solar inverter, I bumped into this default:
As it turns out, the issue with this inverter was that it did not handle pretty-printed JSON. This cost me about 30 minutes of debugging time as I tried to root-cause why the curl equivalent of my command worked, but the swift-openapi-generator equivalent didn't.
In general, I was surprised to see swift-openapi-generator defaulting to pretty-printing JSON. While the default of sortedKeys
makes some sense to me (certain tests are easier to write), the pretty-printed default seems to me to have more downsides with fewer obvious upsides. Most notably, it diverges from common practice in JSON-encoding libraries, which tend to default to minified JSON and require user action to prettify it.
Proposed solution
It seems to me that the community should at least consider whether the default behaviour here should be flipped.
Alternatives considered
No response
Additional information
No response