Answer the question
In order to leave comments, you need to log in
In a JSON file, one of the keys "*" how to parse into the model?
Can you please tell me if it is possible to parse such json into the model?
The problem is that it is impossible to name a property in the * model and I don’t understand what to do with the model, because the property must be named the same as the key.
How to put a pair of "*": "Affenpinscher" into the model?
Or am I focusing on the model in vain?
Answer the question
In order to leave comments, you need to log in
Create a Codable model according to your JSON here https://app.quicktype.io
and already on the finished model
Alamofire.request("", method: .get, parameters: parameters).validate().responseJSON { response in
let jsonDecoder = JSONDecoder()
switch(response.result) {
case .success:
if let data = response.data {
do {
let json = try jsonDecoder.decode(Model.self, from: data)
completion(json, nil)
} catch let error {
print("\n Json Error \n", error.localizedDescription)
}
....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question