<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I have to agree, would be better to allow one to provide a mapping dictionary or delegate. Building the encodingKeys into the class itself is short sighted and a half measure.<div class=""><br class=""></div><div class="">Different types of codings will necessarily desire different key sets and even different names for what are logically the same keys. This absolutely should NOT be baked into the class that implements Codable but rather maybe a delegate that is presented each key/value and given an opportunity to provide a substitute key and value.</div><div class=""><br class=""></div><div class="">Codable is a fairly useless one trick pony in its current incarnation. It doesn't really solve any problem I have with respect to interacting with web services.</div><div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">On Nov 7, 2017, at 2:50 PM, Mike Kluev via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">a big fat -1. sorry.</div><div class=""><br class=""></div>imho, this is barking up the wrong tree and things like converting from camel case / snake case / removal underscores/ capitalization / etc, etc shall not be part of foundation. even if people in the labs asking for that. third party library - probably.<div class=""><br class=""></div><div class="">more easy way to handle keys customization would be nice, last i checked it was "all or nothing", whenever i wanted to customise a single key i had to do them all and the source tripled in size. something simple to avoid that would be enough, imho.</div><div class=""><br class=""></div><div class="">Mike</div><div class=""><br class=""><div class="">on Mon, 06 Nov 2017 12:54:38 -0800 Tony Parker <<a href="mailto:anthony.parker@apple.com" target="_blank" class="">anthony.parker@apple.com</a>> wrote:<div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br class="">
Hi everyone,<br class="">
<br class="">
While we have no formal process at this time for proposals of changes to Foundation-only code, I would still like to post one that we have run through our internal process here for additional public comment.<br class="">
<br class="">
Link to PR with proposal content:<br class="">
<br class="">
<a href="https://github.com/apple/swift-corelibs-foundation/pull/1301" rel="noreferrer" target="_blank" class="">https://github.com/apple/swift<wbr class="">-corelibs-foundation/pull/1301</a><br class="">
<br class="">
Link to implementation for the overlay:<br class="">
<br class="">
<a href="https://github.com/apple/swift/pull/12779" rel="noreferrer" target="_blank" class="">https://github.com/apple/swift<wbr class="">/pull/12779</a> <<a href="https://github.com/apple/swift/pull/12779" rel="noreferrer" target="_blank" class="">https://github.com/apple/swif<wbr class="">t/pull/12779</a>><br class="">
<br class="">
Markdown follows.<br class="">
<br class="">
Thanks,<br class="">
- Tony<br class="">
<br class="">
# Key Strategies for JSONEncoder and JSONDecoder<br class="">
<br class="">
* Proposal: SCLF-0001<br class="">
* Author(s): Tony Parker <<a href="mailto:anthony.parker@apple.com" target="_blank" class="">anthony.parker@apple.com</a>><br class="">
<br class="">
##### Related radars or Swift bugs<br class="">
<br class="">
* <<a href="rdar://problem/33019707" class="">rdar://problem/33019707</a>> Snake case / Camel case conversions for JSONEncoder/Decoder<br class="">
<br class="">
##### Revision history<br class="">
<br class="">
* **v1** Initial version<br class="">
<br class="">
## Introduction<br class="">
<br class="">
While early feedback for `JSONEncoder` and `JSONDecoder` has been very positive, many developers have told us that they would appreciate a convenience for converting between `snake_case_keys` and `camelCaseKeys` without having to manually specify the key values for all types<br class=""></blockquote><div class="">.....</div><div class=""> </div></div></div></div></div></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></div></body></html>