You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In swift code we usually use camelCase while for JSON other convention (mostly snake_case) are used, I would don't like forcing the user to name the property we might have easy ways to support this:
Detailed design
SnakeCaseTransformer(User())// convert the serialized object to snake case
This can be done by using CustomSerializable.
It would be good if the transformed can also be used to rename properties of an entity:
structUser:Serializable{letid:Int}// you want id (Storable) to be named `userId` in the JSONprotocolKeyTransformer:CustomSerializable{func transformedKey(for candidate:String)->String}extensionKeyTransformer{// default implementation that use `transformedKey...`to transform the keys}
The text was updated successfully, but these errors were encountered:
In swift code we usually use camelCase while for JSON other convention (mostly snake_case) are used, I would don't like forcing the user to name the property we might have easy ways to support this:
Detailed design
This can be done by using
CustomSerializable
.It would be good if the transformed can also be used to rename properties of an entity:
The text was updated successfully, but these errors were encountered: