[swift-corelibs-dev] Adding type conversion capabilities to JSON encode/decode
brsneed at ebay.com
Wed Aug 30 17:28:56 CDT 2017
If it failed on all 3, they’d likely fix/rever the service to avoid having *all* clients broken.
From: <anthony.parker at apple.com> on behalf of Tony Parker <anthony.parker at apple.com>
Date: Wednesday, August 30, 2017 at 3:22 PM
To: "Sneed, Brandon" <brsneed at ebay.com>
Cc: Youming Lin <ylin at us.ibm.com>, "swift-corelibs-dev at swift.org" <swift-corelibs-dev at 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 <brsneed at ebay.com<mailto:brsneed at ebay.com>> wrote:
Ah. That should work, and covers benefit #2 I mentioned very nicely. Only downside is that as a developer on an app I may not expect that type to change on the server side so I wouldn’t do it by default, and when it does happen, I then need to apply it to each of its siblings because if it can happen to one, it can happen to the others.
In this case, the server decides to send a String instead of a numeric value for many kinds of types?
I understand that some JSON libraries have options to stringify all numeric values in an attempt to preserve ‘exactness’, although I would argue that this depends on what you do with the numeric value on the other side…
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-corelibs-dev