There might be something to say for defining interfaces up front. Spending over one day cleaning up and re-organizing JSON output throughout multiple subprojects can be quite tedious. Once again, sed proved helpful, but sometimes it's harder to make sed perform like the scalpel than to run a quick grep search and manually edit.
Despite the tedium, it's nice to end up with a cleaner, compliant interface. These are a few of the things fixed:
- Convert dashes in element names to underscores
- Remove integer index references in element names, convert to arrays
- Group common objects into JSON objects
- Write number and boolean elements as such, not as strings