Codable Improvements and Refinements

@xwu Thank you for keeping this thread focused and I apologize for my unproductive reply in the thread :slight_smile:


My personal views reflect those of several others stated upthread that a compiler-centric solution would be optimal over the few library-centric solutions proposed. I'm a lazy person and I'd rather not have to do more work to get my types conforming to Codable. I never really liked having to build an entire CodingKeys enum to get Codable conformance so I agree that using annotations would be a good solution that would feel like less boilerplate, plus with the pitch for user defined attributes I feel that this is tipping towards attribute annotations anyways.

Some have posited that the CodingKeys enum should be replaced and I am inclined to agree, though I also see the benefits that the enum has over simple annotations. Although I do feel that for most use cases the attribute annotations would be adequate, perhaps it would be best to allow one or the other instead of wholly removing the enum with something else. Then the developer can pick the right tool for the job and not all devs are punished with a high amount of boilerplate for simple customizations.