Releases: postmates/PMJSON
Releases · postmates/PMJSON
PMJSON v4.0.0
- 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
.
PMJSON 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)
PMJSON v3.1.1
- Squelch Swift 4.1 warnings.
PMJSON v3.1.0
- Improve
.pretty
output for empty arrays/dictionaries. - Speed up
JSON.encodeAsData()
pretty significantly. It's now very nearly as fast asJSON.encodeAsString()
. - Speed up
JSON.Encoder.encodeAsString()
andJSON.Encoder.encodeAsData()
. - Add a couple of convenience static methods to
JSON
that mimic the enum cases:JSON.int(_:)
andJSON.cgFloat(_:)
. These can be used whenJSON(_:)
triggers too much type complexity. Also add aJSON(_:)
override forCGFloat
. - Add
JSON.Encoder.keyEncodingStrategy
. This is very similar to Swift 4.1'sJSONEncoder.keyEncodingStrategy
, although by default it won't apply to any nested values of typeJSON
orJSONObject
(there's another optionapplyKeyEncodingStrategyToJSONObject
that controls this). - Add
JSON.Decoder.keyDecodingStrategy
. This is very similar to Swift 4.1'sJSONDecoder.keyDecodingStrategy
, although by default it won't apply to decoding any values of typeJSON
orJSONObject
(there's another optionapplyKeyDecodingStrategyToJSONObject
that controls this). - Add
JSON.Encoder.dateEncodingStrategy
. This is very similar toJSONEncoder.dateEncodingStrategy
except it includes another case for encoding ISO8601-formatted dates with fractional seconds (on Apple platforms). - Add
JSON.Decoder.dateDecodingStrategy
. This is very similar toJSONDecoder.dateDecodingStrategy
except it includes another case for decoding ISO8601-formatted dates with fractional seconds (on Apple platforms). - Add
JSON.Encoder.dataEncodingStrategy
. This is identical toJSONEncoder.dataEncodingStrategy
. - Add
JSON.Decoder.dataDecodingStrategy
. This is identical toJSONDecoder.dataDecodingStrategy
.
PMJSON v3.0.2
- Add convenience property
JSONError.path
. - Add method
JSONError.withPrefixedCodingPath(_:)
to make it easier to useJSONError
-throwing methods in aDecodable
implementation.
PMJSON v3.0.1
- Fix Swift Package Manager support.
PMJSON v3.0.0
- Convert to Swift 4.
- Implement
Codable
onJSON
. - Add a
Swift.Decoder
implementation calledJSON.Decoder
. - Add a
Swift.Encoder
implementation calledJSON.Encoder
.
PMJSON v2.0.3
- Add Linux support for
Decimal
(on Swift 3.1 and later). NOTE: Decimal support is still buggy in Swift 3.1, and the workarounds we employ to get the correct values on Apple platforms don't work on Linux. You probably shouldn't rely on this working correctly on Linux until Swift fixes its Decimal implementation. - Add Linux support for decoding from/encoding to
Data
. - Add Linux support for
LocalizedError
on the Error types (only really applies to Swift 3.1 and later). - Fix compilation on Linux using the release configuration.
- Support running the test suite with
swift test
.
PMJSON v2.0.2
- Fixes Linux compatibility
PMJSON v2.0.1
- Add method
JSON.parser(for:options:)
that returns aJSONParser<AnySequence<UnicodeScalar>>
from aData
. LikeJSON.decode(_:options:)
, this method automatically detects UTF-8, UTF-16, or UTF-32 input. - Fix compatibility with Swift Package Manager.