> This has come up a few times in recent threads, and I wanted to gather
> some additional info on your real world use cases. Just reply to me, and
> any input is appreciated:
>
> 1. Does your JSON use snake_case_keys or CamelCase or other?
>

It depends on whether API is intended to be used with JavaScript clients.
JavaScript convention is camelBack so for APIs  designed with primary
intent of having JavaScript clients it is common to have JSON keys using
the same.
In other cases however snake_case is preferable as it is somewhat easier to
read.


> 2. Is the key type consistent throughout the JSON?
>

Hopefully. Inconsistent APIs are painful.


> 3. If JSONEncoder/Decoder converted these, would you have any other need
> to specify custom keys?
>

Generally yes.

Best regards,
Rimantas
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to