PMJSON v4.0.0 Release Notes
Release Date: 2019-11-15 // about 5 years ago-
- ⚡️ Update to Swift 5.
- When encoding/decoding
URL
s withJSON.Encoder
andJSON.Decoder
, encode and decode their absolute string instead of relying on the native implementation which encodes them as an object. This matches the behavior ofJSONEncoder
andJSONDecoder
. - 🛠 Fix availability attribute for
JSON.Encoder.DateEncodingStrategy.iso8601WithFractionalSeconds
. - ⬆️ Bump
JSON.Encoder.DateEncodingStrategy.iso8601WithFractionalSeconds
andJSON.Encoder.DateEncodingStrategy.iso8601WithFractionalSeconds
to iOS 11.2+ and tvOS 11.2+ as, despite the constant being marked as available earlier, it's not supported at runtime. (#33) - Convert
JSONObject.ns
andJSONObject.nsNoNull
to return a[String: Any]
instead of an[AnyHashable: Any]
. (#25) - Split
JSON.Encoder.encodeAs*
andJSON.Decoder.decode
methods into overload pairs where one takesoptions:
and the other doesn't. This makes it easier to replace function references toJSONEncoder
/JSONDecoder
methods with the equivalents from PMJSON. - ➕ Add conformance to Combine's
TopLevelEncoder
andTopLevelDecoder
, usingData
as the input/output type. This means thatJSON.Encoder.encode(_:)
is now marked as deprecated instead of unavailable. - Rename
JSON.flatMap*
andJSONObject.flatMap*
methods to.compactMap*
instead when the transformation returns an optional. (#28) - Mark a lot of methods as
@inlinable
.
Previous changes from v3.1.2
-
- ➕ Add method
JSONError.withPrefix(_:)
that returns a new error by prepending a prefix onto the path. This can be used in custom parsing code to produce good errors if the existing convenience functions don't do what you want. (#26)
- ➕ Add method