1. Does your JSON use snake_case_keys or CamelCase or other?
My internal APIs use snake_case. Several APIs I write against (not necessarily in Swift), like Heroku and Stripe, also use snake_case. The JSON Feed format uses snake_case.
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?
Occasionally, but far less often. For instance, when adapting an API that used Rails conventions, I would still want to translate `created_at` dates to `creationDate`. But that assumes I wanted to use those dates at all—I often ignore them.
If you're considering adding a key transformation strategy to JSONEncoder/Decoder, I strongly encourage you to do so. Case transformation will handle at least 80% of the custom keys, and even when people *do* still need to customize further, case transformation will help them do it more easily. And if you *did* want to provide a `custom` option, it might allow developers to move *all* of their custom JSON key names out of their `Codable` implementations, which would make them easier to use with multiple coders.
On Jun 23, 2017, at 9:42 AM, Tony Parker via swift-users <email@example.com> wrote: