[swift-users] JSON keys survey
matthew at anandabits.com
Fri Jun 23 13:11:38 CDT 2017
> 1. Does your JSON use snake_case_keys or CamelCase or other?
I usually see snake_case or lowerCamelCase. They are roughly equally common in my experience.
> 2. Is the key type consistent throughout the JSON?
> 3. If JSONEncoder/Decoder converted these, would you have any other need to specify custom keys?
Often times yes. It is not uncommon to use property names an app that are different than json key names. One example of why this happens is that names used in an app are often aligned with UX terminology which does not always match terminology used by an API. Another reason that is unfortunate but is out of our control is that we are often developing against shifting API specs.
More information about the swift-users