All Versions
11
Latest Version
Avg Release Cycle
105 days
Latest Release
27 days ago

Changelog History
Page 1

  • v4.0.0

    November 15, 2019
    • ⚡️ 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.
  • v3.1.2

    November 07, 2018
    • ➕ 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)
  • v3.1.1

    May 18, 2018
    • ⚠ Squelch Swift 4.1 warnings.
  • v3.1.0

    February 26, 2018
    • 👌 Improve .pretty output for empty arrays/dictionaries.
    • Speed up JSON.encodeAsData() pretty significantly. It's now very nearly as fast as JSON.encodeAsString().
    • Speed up JSON.Encoder.encodeAsString() and JSON.Encoder.encodeAsData().
    • Add a couple of convenience static methods to JSON that mimic the enum cases: JSON.int(_:) and JSON.cgFloat(_:). These can be used when JSON(_:) triggers too much type complexity. Also add a JSON(_:) override for CGFloat.
    • ➕ Add JSON.Encoder.keyEncodingStrategy. This is very similar to Swift 4.1's JSONEncoder.keyEncodingStrategy, although by default it won't apply to any nested values of type JSON or JSONObject (there's another option applyKeyEncodingStrategyToJSONObject that controls this).
    • ➕ Add JSON.Decoder.keyDecodingStrategy. This is very similar to Swift 4.1's JSONDecoder.keyDecodingStrategy, although by default it won't apply to decoding any values of type JSON or JSONObject (there's another option applyKeyDecodingStrategyToJSONObject that controls this).
    • ➕ Add JSON.Encoder.dateEncodingStrategy. This is very similar to JSONEncoder.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 to JSONDecoder.dateDecodingStrategy except it includes another case for decoding ISO8601-formatted dates with fractional seconds (on Apple platforms).
    • ➕ Add JSON.Encoder.dataEncodingStrategy. This is identical to JSONEncoder.dataEncodingStrategy.
    • ➕ Add JSON.Decoder.dataDecodingStrategy. This is identical to JSONDecoder.dataDecodingStrategy.
  • v3.0.2

    February 22, 2018
    • ➕ Add convenience property JSONError.path.
    • ➕ Add method JSONError.withPrefixedCodingPath(_:) to make it easier to use JSONError-throwing methods in a Decodable implementation.
  • v3.0.1

    February 19, 2018
    • 🛠 Fix Swift Package Manager support.
  • v3.0.0

    February 19, 2018
    • Convert to Swift 4.
    • Implement Codable on JSON.
    • ➕ Add a Swift.Decoder implementation called JSON.Decoder.
    • ➕ Add a Swift.Encoder implementation called JSON.Encoder.
  • v2.0.3

    September 12, 2017
    • ➕ 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.
  • v2.0.2

    March 06, 2017
    • 🛠 Fixes Linux compatibility
  • v2.0.1

    February 26, 2017
    • ➕ Add method JSON.parser(for:options:) that returns a JSONParser<AnySequence<UnicodeScalar>> from a Data. Like JSON.decode(_:options:), this method automatically detects UTF-8, UTF-16, or UTF-32 input.
    • 🛠 Fix compatibility with Swift Package Manager.