Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Sneed, Brandon via swift-corelibs-dev
17 at 3:22 PM To: "Sneed, Brandon" <brsn...@ebay.com> Cc: Youming Lin <y...@us.ibm.com>, "swift-corelibs-dev@swift.org" <swift-corelibs-dev@swift.org> Subject: Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode On

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Sneed, Brandon via swift-corelibs-dev
ibs-dev@swift.org" <swift-corelibs-dev@swift.org> Subject: Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode On Aug 30, 2017, at 3:12 PM, Sneed, Brandon <brsn...@ebay.com<mailto:brsn...@ebay.com>> wrote: Thanks Tony, Ah. That sho

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Sneed, Brandon via swift-corelibs-dev
elibs-dev-boun...@swift.org" <swift-corelibs-dev-boun...@swift.org> Subject: Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode Brandon Sorry, I didn't realize you want it on the String type since you used other string ivars in your example as well

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Tony Parker via swift-corelibs-dev
on behalf of Tony Parker > <anthony.par...@apple.com> > Date: Wednesday, August 30, 2017 at 3:04 PM > To: "Sneed, Brandon" <brsn...@ebay.com> > Cc: Youming Lin <y...@us.ibm.com>, "swift-corelibs-dev@swift.org" > <swift-corelibs-dev@swift

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Youming Lin via swift-corelibs-dev
ev-boun...@swift.org> Date: 08/30/2017 04:42 PM Subject:Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode Thanks Youming, That’s not quite what I meant. I may have misinterpreted what Tony was saying though. I wanted to do conversi

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Sneed, Brandon via swift-corelibs-dev
<swift-corelibs-dev@swift.org> Subject: Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode I haven’t tried this myself yet, but you could imagine creating a type which represents an ABV and decodes using a single value container. Then, your custom behavio

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Tony Parker via swift-corelibs-dev
ailto:anthony.par...@apple.com>>, > "swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>" > <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>>, > "swift-corelibs-dev-boun...@swift.org > <mailto:swift-corel

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Sneed, Brandon via swift-corelibs-dev
pple.com>, "swift-corelibs-dev@swift.org" <swift-corelibs-dev@swift.org>, "swift-corelibs-dev-boun...@swift.org" <swift-corelibs-dev-boun...@swift.org> Subject: Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode Brandon I cooked

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Youming Lin via swift-corelibs-dev
"swift-corelibs-dev@swift.org" <swift-corelibs-dev@swift.org>, "swift-corelibs-dev-boun...@swift.org" <swift-corelibs-dev-boun...@swift.org> Date: 08/30/2017 04:14 PM Subject:Re: [swift-corelibs-dev] Adding type conversion c

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Sneed, Brandon via swift-corelibs-dev
com>, "swift-corelibs-dev@swift.org" <swift-corelibs-dev@swift.org>, "swift-corelibs-dev-boun...@swift.org" <swift-corelibs-dev-boun...@swift.org> Subject: Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode Brandon >JSON

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Youming Lin via swift-corelibs-dev
libs-dev" <swift-corelibs-dev@swift.org> To: Tony Parker <anthony.par...@apple.com> Cc: "swift-corelibs-dev@swift.org" <swift-corelibs-dev@swift.org> Date: 08/30/2017 03:07 PM Subject: Re: [swift-corelibs-dev] Adding type conversion capab

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Sneed, Brandon via swift-corelibs-dev
st 30, 2017 at 11:22 AM To: "Sneed, Brandon" <brsn...@ebay.com<mailto:brsn...@ebay.com>> Cc: "swift-corelibs-dev@swift.org<mailto:swift-corelibs-dev@swift.org>" <swift-corelibs-dev@swift.org<mailto:swift-corelibs-dev@swift.org>> Subject: Re:

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Sneed, Brandon via swift-corelibs-dev
f Itai Ferber <ifer...@apple.com> Date: Wednesday, August 30, 2017 at 11:22 AM To: "Sneed, Brandon" <brsn...@ebay.com> Cc: "swift-corelibs-dev@swift.org" <swift-corelibs-dev@swift.org> Subject: Re: [swift-corelibs-dev] Adding type conversion capabilities

Re: [swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Itai Ferber via swift-corelibs-dev
Hi Brandon, Thanks for looking at this! We’ve got plans internally to potentially add a strategy to `JSONEncoder`/`JSONDecoder` to allow lenient conversions like this — i.e. implicitly stringify numbers (or parse them from string input), among some others. This would be opt-in for consumers

[swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode

2017-08-30 Thread Sneed, Brandon via swift-corelibs-dev
Hi everyone, Just throwing this out to see if anyone else is working on this, or has opinions/suggestions on how it’s implemented. I’d like to add this to the Codable/JSONDecoder/JSONEncoder system if no one else is working on it. Type type conversion, I mean given this JSON payload: {