Skip to content

PMJSON v4.0.0

Latest
Compare
Choose a tag to compare
@lilyball lilyball released this 15 Nov 04:46
· 2 commits to master since this release
  • Update to Swift 5.
  • When encoding/decoding URLs with JSON.Encoder and JSON.Decoder, encode and decode their absolute string instead of relying on the native implementation which encodes them as an object. This matches the behavior of JSONEncoder and JSONDecoder.
  • Fix availability attribute for JSON.Encoder.DateEncodingStrategy.iso8601WithFractionalSeconds.
  • Bump JSON.Encoder.DateEncodingStrategy.iso8601WithFractionalSeconds and JSON.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 and JSONObject.nsNoNull to return a [String: Any] instead of an [AnyHashable: Any]. (#25)
  • Split JSON.Encoder.encodeAs* and JSON.Decoder.decode methods into overload pairs where one takes options: and the other doesn't. This makes it easier to replace function references to JSONEncoder/JSONDecoder methods with the equivalents from PMJSON.
  • Add conformance to Combine's TopLevelEncoder and TopLevelDecoder, using Data as the input/output type. This means that JSON.Encoder.encode(_:) is now marked as deprecated instead of unavailable.
  • Rename JSON.flatMap* and JSONObject.flatMap* methods to .compactMap* instead when the transformation returns an optional. (#28)
  • Mark a lot of methods as @inlinable.