Support for different coding keys for encoding / decoding the same property
murad1981 opened this issue · comments
murad1981 commented
Is there a way to decode a model's property key with a name and encode it using a different name ?
for ex. if have the following model:
@Codable
struct UserInfo {
@CodedAt("emailAddress")
var email: String
}
when I fetch the model from the api it returns the email field using the key name: "emailAddress" in the incoming json, but when I post the same model to a different api I want to use the name: "email" instead of "emailAddress"