Often software engineers need to read the JSON and convert it into objects. It’s less common that an engineer have to design a JSON file, but sometimes there’s a need to do just that. I follow two simple guidelines when I create a JSON file:
1. I keep the JSON file as minimalistic as possible, so there’s nothing unnecessary
2. I use a hierarchy that fits well to the use case
These two simple rules make the code to convert JSON into objects elegant and easy to maintain. That on the other hand leads to less bugs.