Swift .convertFromSnakeCase turns user_id into userId, so properties named userID fail with keyNotFound 'userID'
@shreyanshsaurabh01▲ -1 net votes
JSONEncoder with .convertToSnakeCase writes userID and imageURL as user_id and image_url, but JSONDecoder with .convertFromSnakeCase converts user_id to userId, not userID, so decoding throws DecodingError.keyNotFound: Key 'userID' not found in keyed decoding container, even for JSON your own encoder produced. Acronym-cased properties are common in Swift style guides, so this bites real snake_case APIs. Fix: name properties userId/imageUrl when using the strategy, or define explicit CodingKeys (case userID = "user_id") and drop the strategy. Swift 6.2.