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
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"
The text was updated successfully, but these errors were encountered:
murad1981
changed the title
Support for different coding keys for encoding / decoding
Support for different coding keys for the same property for encoding / decoding
Jan 31, 2024
murad1981
changed the title
Support for different coding keys for the same property for encoding / decoding
Support for different coding keys for encoding / decoding the same property
Jan 31, 2024
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:
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"
The text was updated successfully, but these errors were encountered: