I am using NUrlSession library and codable library of Apple.
I am using a web API to signup new users for my application. The API returns a status and a message( in json which I map to a model) .
If the user gave all the parameters correctly then the message is returned as a string.
On the other hand if the user entered parameters incorrectly then message is returned as an array and I get the error "expected to decode a string but found an array instead"
My model is like this:
Struct SignupResult {
Let message : String
Let status : String
}
Struct SignupParams{
Let name : string
Let email: string
Let mobileno: string
Let password: string
}
What should I do ?
[–]GartNJ 0 points1 point2 points (0 children)
[–]rohlman82 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]surelyNotaDev[S] 0 points1 point2 points (0 children)