* Add deferredToData strategy on encode and decode
* Rename base64{Encode,Decode} to base64 (missed this in previous fixes)
* Add unit test to confirm behavior
Allow JSONEncoder/JSONDecoder to intercept Decimal values so they get
a numeric representation in JSON (instead of their default keyed
implementation).
On encode, we previously treated every container request as a push;
instead, we should allow the same container type to be requested
multiple times so a class can pass its Encoder directly to its
superclass if it needs to.
SingleValueDecondingContainers in JSON and Plist previously held the
assertion that attempting to decode an array or dictionary from them
was a type mismatch (since those represented unkeyed and keyed
containers, respectively). This assertion is no longer true, though,
since encode<T : Encodable>(_:) and decode<T : Decodable>(_:) allow
you to do just that.
This lifts the assertion and adds unit tests to both implementations to
ensure this works. (Addresses https://bugs.swift.org/browse/SR-5089)
Optional properties now get synthesized encodeIfPresent(...) and
decodeIfPresent(...) calls (to avoid encoding needless information, and
to be more accepting on input).
codingPath more often than not actually needs to be copied, not just
referenced. This makes a big difference for nested containers and
subobjects, which were getting the wrong codingPath values when asking
for them.
This also adds unit tests for JSONEncoder and PropertyListEncoder to
confirm expected behavior.