OpenAI
OpenAI copied to clipboard
Codable > Encodable | Decodable
What
be specific with Codable: use Encodable for queries, Decodable for results, instead of Codable for everything
Why
accurate inheritance prevents accidental misuse
Affected Areas
JSON encoding and decoding during networking
NOTE
I don't know what to do with the .stub() functions, which require that Responses are Encodable for testing purposes, when Responses should only have to be Decodable.
Hey, @kalafus, thanks for your contribution! ✨ You're absolutely right about:
accurate inheritance prevents accidental misuse
It seems like tests here require some fixing now too 🙏🏼
had to add a surprising amount of code due to an error that extensions for the Encodable protocol won't automatically implement this way... but it's done. have any ideas to de-duplicate? there's got to be a better way!
Quality Gate passed
Issues
0 New issues
Measures
0 Security Hotspots
No data about Coverage
1.9% Duplication on New Code