JSONDecoder always returns “No value associated with key CodingKeys”
I am using following decoding struct to decode the data from server but it always returns "No value associated with key CodingKeys". Please see the code below struct UserDecode: Codable { var user: User? var result: String? private enum CodingKeys: String, CodingKey { case user = "Records" case result = "Result" } init(from decoder: Decoder) throws { do { let values = try decoder.container(keyedBy: CodingKeys.self) result = try values.decode(String.self, forKey: .result) user = try values.decode(User.self, forKey: .user) } catch { print(error.localizedDescription) } } } struct User: Codable {