Elevate is a JSON parsing framework that leverages Swift to make parsing simple, reliable and composable

Related tags

JSON Elevate
Overview

Elevate

Build Status CocoaPods Compatible Carthage Compatible Platform

Elevate is a JSON parsing framework that leverages Swift to make parsing simple, reliable and composable.

Elevate should no longer be used for new feature development. We recommend using the Codable protocol provided by Apple in the Foundation framework in its place. We will continue to support and update Elevate for the foreseeable future.

Features

  • Validation of full JSON payload
  • Parse complex JSON into strongly typed objects
  • Support for optional and required values
  • Convenient and flexible protocols to define object parsing
  • Large object graphs can be parsed into their component objects
  • Error aggregation across entire object graph

Requirements

  • iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+
  • Xcode 10.2+
  • Swift 5.0+

Communication

  • Need help? Open an issue.
  • Have a feature request? Open an issue.
  • Find a bug? Open an issue.
  • Want to contribute? Fork the repo and submit a pull request.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

[sudo] gem install cocoapods

CocoaPods 1.3+ is required.

To integrate Elevate into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
use_frameworks!

pod 'Elevate', '~> 3.0'

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

brew update
brew install carthage

To integrate Elevate into your Xcode project using Carthage, specify it in your Cartfile:

3.0 ">
github "Nike-Inc/Elevate" ~> 3.0

To build Elevate on iOS only, use the following Carthage command:

carthage update --platform iOS

Usage

Elevate aims to make JSON parsing and validation simple, yet robust. This is achieved through a set of protocols and classes that can be utilized to create Decodable and Decoder classes. By using Elevate's parsing infrastructure, you'll be able to easily parse JSON data into strongly typed model objects or simple dictionaries by specifying each property key path and its associated type. Elevate will validate that the keys exist (if they're not optional) and that they are of the correct type. Validation errors will be aggregated as the JSON data is parsed. If an error is encountered, a ParserError will be thrown.

Elevate also supports encoding model objects back into JSON objects through the light-weight Encodable protocol. Convenience extensions have been added to collection types to make it easy to encode nested objects in a single pass.

Parsing JSON with Elevate

After you have made your model objects Decodable or implemented a Decoder for them, parsing with Elevate is as simple as:

let avatar: Avatar = try Elevate.decodeObject(from: data, atKeyPath: "response.avatar")

Pass an empty string into atKeyPath if your object or array is at the root level.

Creating Decodables

In the previous example Avatar implements the Decodable protocol. By implementing the Decodable protocol on an object, it can be used by Elevate to parse avatars from JSON data as a top-level object, a sub-object, or even an array of avatar objects.

public protocol Decodable {
    init(json: Any) throws
}

The json: Any will typically be a [String: Any] instance that was created from the JSONSerialization APIs. Use the Elevate Parser.parseEntity method to define the structure of the JSON data to be validated and perform the parsing.

struct Person {
    let identifier: String
    let name: String
    let nickname: String?
    let birthDate: Date
    let isMember: Bool?
    let addresses: [Address]
}

extension Person: Elevate.Decodable {
    fileprivate struct KeyPath {
        static let id = "identifier"
        static let name = "name"
        static let nickname = "nickname"
        static let birthDate = "birthDate"
        static let isMember = "isMember"
        static let addresses = "addresses"
    }

    init(json: Any) throws {
        let dateDecoder = DateDecoder(dateFormatString: "yyyy-MM-dd")

        let entity = try Parser.parseEntity(json: json) { schema in
            schema.addProperty(keyPath: KeyPath.id, type: .int)
            schema.addProperty(keyPath: KeyPath.name, type: .string)
            schema.addProperty(keyPath: KeyPath.nickname, type: .string, optional: true)
            schema.addProperty(keyPath: KeyPath.birthDate, type: .string, decoder: dateDecoder)
            schema.addProperty(keyPath: KeyPath.isMember, type: .bool, optional: true)
            schema.addProperty(keyPath: KeyPath.addresses, type: .array, decodableType: Address.self)
        }

        self.identifier = entity <-! KeyPath.id
        self.name = entity <-! KeyPath.name
        self.nickname = entity <-? KeyPath.nickname
        self.birthDate = entity <-! KeyPath.birthDate
        self.isMember = entity <-? KeyPath.isMember
        self.addresses = entity <--! KeyPath.addresses
    }
}

Implementing the Decodable protocol in this way allows you to create fully intialized structs that can contain non-optional constants from JSON data.

Some other things worth noting in this example:

  1. The Decodable protocol conformance was implemented as an extension on the struct. This allows the struct to keep its automatic memberwise initializer.
  2. Standard primitive types are supported as well as URL, Array, and Dictionary types. See ParserPropertyProtocol definition for the full list.
  3. Elevate facilitates passing a parsed property into a Decoder for further manipulation. See the birthDate property in the example above. The DateDecoder is a standard Decoder provided by Elevate to make date parsing hassle free.
  4. A Decoder or Decodable type can be provided to a property of type .Array to parse each item in the array to that type. This also works with the .Dictionary type to parse a nested JSON object.
  5. The parser guarantees that properties will be of the specified type. Therefore, it is safe to use the custom operators to automatically extract the Any value from the entity dictionary and cast it to the return type.

Property Extraction Operators

Elevate contains four property extraction operators to make it easy to extract values out of the entity dictionary and cast the Any value to the appropriate type.

  • <-! - Extracts the value from the entity dictionary for the specified key. This operator should only be used on non-optional properties.
  • <-? - Extracts the optional value from the entity dictionary for the specified key. This operator should only be used on optional properties.
  • <--! - Extracts the array from the entity dictionary for the specified key as the specified array type. This operator should only be used on non-optional array properties.
  • <--? - Extracts the array from the entity dictionary for the specified key as the specified optional array type.

Creating Encodables

Extending a model object to conform to the Encodable protocol is less involved than making it Decodable. Since your object is already strongly typed, it only needs to be converted into a JSON friendly Any object. Building on the previous Person type, let's make it conform to the Encodable protocol.

extension Person: Elevate.Encodable {
    var json: Any {
        var json: [String: Any] = [
            KeyPath.id: identifier,
            KeyPath.name: name,
            KeyPath.birthDate: birthDate,
            KeyPath.addresses: addresses.json
        ]

        if let nickname = nickname { json[KeyPath.nickname] = nickname }
        if let isMember = isMember { json[KeyPath.isMember] = isMember }

        return json
    }
}

As you can see in the example, converting the Person into a JSON dictionary is straightforward. It's also easy to convert the array of Address objects into JSON by calling the json property on the array. This works because Address also conforms to Encodable. The collection type extensions on Array, Set and Dictionary make it easy to convert a complex objects with multiple layers of Encodable objects into a JSON objects.


Advanced Usage

Decoders

In most cases implementing a Decodable model object is all that is needed to parse JSON using Elevate. There are some instances though where you will need more flexibility in the way that the JSON is parsed. This is where the Decoder protocol comes in.

public protocol Decoder {
    func decode(_ object: Any) throws -> Any
}

A Decoder is generally implemented as a separate object that returns instances of the desired model object. This is useful when you have multiple JSON mappings for a single model object, or if you are aggregating data across multiple JSON payloads. For example, if there are two separate services that return JSON for Avatar objects that have a slightly different property structure, a Decoder could be created for each mapping to handle them individually.

The input type and output types are intentionally vague to allow for flexibility. A Decoder can return any type you want -- a strongly typed model object, a dictionary, etc. It can even dynamically return different types at runtime if needed.

Using Multiple Decoders

class AvatarDecoder: Elevate.Decoder {
    func decode(_ object: Any) throws -> Any {
        let urlKeyPath = "url"
        let widthKeyPath = "width"
        let heightKeyPath = "height"

        let entity = try Parser.parseEntity(json: object) { schema in
            schema.addProperty(keyPath: urlKeyPath, type: .url)
            schema.addProperty(keyPath: widthKeyPath, type: .int)
            schema.addProperty(keyPath: heightKeyPath, type: .int)
        }

        return Avatar(
            URL: entity <-! urlKeyPath,
            width: entity <-! widthKeyPath,
            height: entity <-! heightKeyPath
        )
    }
}
class AlternateAvatarDecoder: Elevate.Decoder {
    func decode(_ object: Any) throws -> Any {
        let locationKeyPath = "location"
        let wKeyPath = "w"
        let hKeyPath = "h"

        let entity = try Parser.parseEntity(json: object) { schema in
            schema.addProperty(keyPath: locationKeyPath, type: .url)
            schema.addProperty(keyPath: wKeyPath, type: .int)
            schema.addProperty(keyPath: hKeyPath, type: .int)
        }

        return Avatar(
            URL: entity <-! locationKeyPath,
            width: entity <-! wKeyPath,
            height: entity <-! hKeyPath
        )
    }
}

Then to use the two different Decoder objects with the Parser:

let avatar1: Avatar = try Elevate.decodeObject(
    from: data1, 
    atKeyPath: "response.avatar", 
    with: AvatarDecoder()
)

let avatar2: Avatar = try Elevate.decodeObject(
    from: data2, 
    atKeyPath: "alternative.response.avatar", 
    with: AlternateAvatarDecoder()
)

Each Decoder is designed to handle a different JSON structure for creating an Avatar. Each uses the key paths specific to the JSON data it's dealing with, then maps those back to the properties on the Avatar object. This is a very simple example to demonstration purposes. There are MANY more complex examples that could be handled in a similar manner via the Decoder protocol.

Decoders as Property Value Transformers

A second use for the Decoder protocol is to allow for the value of a property to be further manipulated. The most common example is a date string. Here is how the DateDecoder implements the Decoder protocol:

public func decode(_ object: Any) throws -> Any {
    if let string = object as? String {
        return try dateFromString(string, withFormatter:self.dateFormatter)
    } else {
        let description = "DateParser object to parse was not a String."
        throw ParserError.Validation(failureReason: description)
    }
}

And here is how it's used to parse a JSON date string:

let dateDecoder = DateDecoder(dateFormatString: "yyyy-MM-dd 'at' HH:mm")

let entity = try Parser.parseEntity(data: data) { schema in
    schema.addProperty(keyPath: "dateString", type: .string, decoder: dateDecoder)
}

You are free to create any decoders that you like and use them with your properties during parsing. Some other uses would be to create a StringToBoolDecoder or StringToFloatDecoder that parses a Bool or Float from a JSON string value. The DateDecoder and StringToIntDecoder are already included in Elevate for your convenience.


Creators

Comments
  • How to parse array of polymorphic objects?

    How to parse array of polymorphic objects?

    Hi! Thanks for wonderful framework. I've encountered one issue, I can't figure out. Let's say I have:

    class A {
        let type: String
        /*lots of properties*/
     }
    

    and

    final class B: A {
        /*some other properties*/
    }
    

    In my response I have JSON-array of objects and some of them turn out to be B's. The type of object determined by type field. Is it possible to use Elevate in this situation? How should I organise my decoding?

    question decoder 
    opened by rehsals 4
  • Question: Side-by-side usage with Realm?

    Question: Side-by-side usage with Realm?

    Hi, guys. First of all, this lib is amazing.

    Second, I was thinking on using this lib with my previous Swift project which I use Realm, currently on production.

    But I've got an issue on the inits. It seems that these must-use libraries just don't get along.

    Consider this situation:

    
    import Foundation
    import Elevate
    import Realm
    import RealmSwift
    
    // Class Event
    class Event: Object, Decodable {
    
        var time: Int!
        var _description: String!
        var team: String!
    
        // MARK: START - Realm
        required init() {
            super.init()
        }
    
        required init(realm: RLMRealm, schema: RLMObjectSchema) {
            super.init(realm: realm, schema: schema)
        }
    
        required init(value: AnyObject, schema: RLMSchema) {
            super.init(value: value, schema: schema)
        }
        // MARK: END - Realm
    
    
        // MARK: START - Elevate
        required init(json: AnyObject) throws {
    
            let properties = try Parser.parseProperties(json: json) { make in
    
                make.propertyForKeyPath(Strings.timeKeyPath, type: .Int)
                make.propertyForKeyPath(Strings.descriptionKeyPath, type: .String)
                make.propertyForKeyPath(Strings.teamKeyPath, type: .String)
    
            }
    
            self.time = properties <-! Strings.timeKeyPath
            self._description = properties <-! Strings.descriptionKeyPath
            self.team = properties <-! Strings.teamKeyPath
    
        }
    
        func prepare() -> [String: AnyObject] {
    
            return [
                Strings.timeKeyPath: self.time,
                Strings.descriptionKeyPath: self._description,
                Strings.teamKeyPath: self.team
            ]
    
        }
        // MARK: END - Elevate
    
    }
    
    

    It not only asks to insert Realm inits on my code but also complains about Elevate init with the message Super.init isn't called on all paths before returning from initializer.

    Any tips regarding this? Is there a different way to use Elevate?!

    opened by LeonardoCardoso 2
  • Wrong version on README.md

    Wrong version on README.md

    On the section Installation, both CocoaPods and Carthage have version 1.0, while the right version is 1.0.0.

    pod 'Elevate', '~> 1.0'
    
    github "Nike-Inc/Elevate" ~> 1.0
    

    On CocoaPods, this will cause the error:

    [!] Unable to find a specification for `Elevate (~> 1.0)`
    
    cocoapods support 
    opened by LeonardoCardoso 2
  • Change `parseEntity` to not wrap errors thrown by Decoders and Decodables.

    Change `parseEntity` to not wrap errors thrown by Decoders and Decodables.

    Change parseEntity to not wrap errors thrown by Decoders and Decodables in a ParserError. This allows the decoding process to report error conditions discovered in the JSON (e.g. embedded error codes) as something other than parsing errors.

    Added Decoder and Decodable tests to validate that custom errors can be caught as expected.

    decodable decoder parser 
    opened by AtomicCat 1
  • Wrong vars on README.md

    Wrong vars on README.md

    On this section Using Multiple Decoders, the var json is not declared:

    Instead Parser.parseEntity(json: json) shouldn't it be Parser.parseEntity(json: object)?

    bug documentation 
    opened by LeonardoCardoso 1
  • Updated README example to align with text

    Updated README example to align with text

    Issue #15 -- The first note below the Person example code refers to declaring the Decodable conformance in an extension. Updated the example code to reflect this.

    documentation 
    opened by richellis 1
  • Clarify README `Person` example to align with notes in text below

    Clarify README `Person` example to align with notes in text below

    The text states "The Decodable protocol conformance was implemented as an extension on the struct", but the code block does not do this, it was changed somewhere along the way.

    Pull request to fix forthcoming. :)

    documentation 
    opened by richellis 1
  • Switching from AnyObject to Any

    Switching from AnyObject to Any

    This PR has a few commits cleaning up some of the older logic to use some more condensed logic as well as a big change which switches from AnyObject to Anythroughout the Elevate APIs. Since JSONSerialization has now moved to using Any instead of AnyObject, our Elevate APIs should match. We also may "have" to do this to support Linux.

    We still need to confirm this.

    These changes have a small performance impact that needs to be called out. I've noticed the performance test increase by about 7-8% when running several iterations in the simulator. It may be possible to figure out which cast is being more costly. I'm assuming we're now having to bridge back and forth between Objective-C objects and Swift objects than we were before with AnyObject. However, this may not matter in the end if Linux can only use Any.

    We're thinking Linux may be the main reason this change is necessary since it won't have bridging between Objective-C and Swift which is why AnyObject works. All values supported by JSONSerialization in the OSS version of Swift are value types.

    opened by cnoon 1
  • Feature - More Swift 3 Updates

    Feature - More Swift 3 Updates

    This PR refactors some of the APIs to be more Swift 3 friendly. More details are broken out in the commit log. Let's chat through these changes in person to decide if we think these are all the best Swift 3 stylistic decisions.

    opened by cnoon 1
  • Dropped Swift 4.2 Support, updated deployment targets

    Dropped Swift 4.2 Support, updated deployment targets

    • Dropped Swift 4.2 Support
    • ios depoyment target updated to 10.0
    • macOS deployment target updated to 10.12
    • tvOS deployment target updated to 10.0
    • watchOS deployment target update to 3.0
    carthage cocoapods swift swift package manager 
    opened by dfuerle 0
  • Feature - Travis-CI Updates

    Feature - Travis-CI Updates

    This PR adds a Gemfile and lock file to the project along with locking to Ruby 2.4.3 (pre-installed on Travis). It also updates the Travis-CI YAML file to use bundler and Xcode 10.

    project config travis ci 
    opened by cnoon 0
  • Bump tzinfo from 1.2.5 to 1.2.10

    Bump tzinfo from 1.2.5 to 1.2.10

    Bumps tzinfo from 1.2.5 to 1.2.10.

    Release notes

    Sourced from tzinfo's releases.

    v1.2.10

    TZInfo v1.2.10 on RubyGems.org

    v1.2.9

    • Fixed an incorrect InvalidTimezoneIdentifier exception raised when loading a zoneinfo file that includes rules specifying an additional transition to the final defined offset (for example, Africa/Casablanca in version 2018e of the Time Zone Database). #123.

    TZInfo v1.2.9 on RubyGems.org

    v1.2.8

    • Added support for handling "slim" format zoneinfo files that are produced by default by zic version 2020b and later. The POSIX-style TZ string is now used calculate DST transition times after the final defined transition in the file. The 64-bit section is now always used regardless of whether Time has support for 64-bit times. #120.
    • Rubinius is no longer supported.

    TZInfo v1.2.8 on RubyGems.org

    v1.2.7

    • Fixed 'wrong number of arguments' errors when running on JRuby 9.0. #114.
    • Fixed warnings when running on Ruby 2.8. #112.

    TZInfo v1.2.7 on RubyGems.org

    v1.2.6

    • Timezone#strftime('%s', time) will now return the correct number of seconds since the epoch. #91.
    • Removed the unused TZInfo::RubyDataSource::REQUIRE_PATH constant.
    • Fixed "SecurityError: Insecure operation - require" exceptions when loading data with recent Ruby releases in safe mode.
    • Fixed warnings when running on Ruby 2.7. #106 and #111.

    TZInfo v1.2.6 on RubyGems.org

    Changelog

    Sourced from tzinfo's changelog.

    Version 1.2.10 - 19-Jul-2022

    Version 1.2.9 - 16-Dec-2020

    • Fixed an incorrect InvalidTimezoneIdentifier exception raised when loading a zoneinfo file that includes rules specifying an additional transition to the final defined offset (for example, Africa/Casablanca in version 2018e of the Time Zone Database). #123.

    Version 1.2.8 - 8-Nov-2020

    • Added support for handling "slim" format zoneinfo files that are produced by default by zic version 2020b and later. The POSIX-style TZ string is now used calculate DST transition times after the final defined transition in the file. The 64-bit section is now always used regardless of whether Time has support for 64-bit times. #120.
    • Rubinius is no longer supported.

    Version 1.2.7 - 2-Apr-2020

    • Fixed 'wrong number of arguments' errors when running on JRuby 9.0. #114.
    • Fixed warnings when running on Ruby 2.8. #112.

    Version 1.2.6 - 24-Dec-2019

    • Timezone#strftime('%s', time) will now return the correct number of seconds since the epoch. #91.
    • Removed the unused TZInfo::RubyDataSource::REQUIRE_PATH constant.
    • Fixed "SecurityError: Insecure operation - require" exceptions when loading data with recent Ruby releases in safe mode.
    • Fixed warnings when running on Ruby 2.7. #106 and #111.
    Commits
    • 0814dcd Fix the release date.
    • fd05e2a Preparing v1.2.10.
    • b98c32e Merge branch 'fix-directory-traversal-1.2' into 1.2
    • ac3ee68 Remove unnecessary escaping of + within regex character classes.
    • 9d49bf9 Fix relative path loading tests.
    • 394c381 Remove private_constant for consistency and compatibility.
    • 5e9f990 Exclude Arch Linux's SECURITY file from the time zone index.
    • 17fc9e1 Workaround for 'Permission denied - NUL' errors with JRuby on Windows.
    • 6bd7a51 Update copyright years.
    • 9905ca9 Fix directory traversal in Timezone.get when using Ruby data source
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump cocoapods-downloader from 1.2.2 to 1.6.3

    Bump cocoapods-downloader from 1.2.2 to 1.6.3

    Bumps cocoapods-downloader from 1.2.2 to 1.6.3.

    Release notes

    Sourced from cocoapods-downloader's releases.

    1.6.3

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.2

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.1

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.0

    Enhancements
    • None.
    Bug Fixes
    • Adds a check for command injections in the input for hg and git.
      orta #124

    1.5.1

    Enhancements
    • None.
    Bug Fixes
    • Fix "can't modify frozen string" errors when pods are integrated using the branch option
      buju77 #10920

    1.5.0

    ... (truncated)

    Changelog

    Sourced from cocoapods-downloader's changelog.

    1.6.3 (2022-04-01)

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.2 (2022-03-28)

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.1 (2022-03-23)

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.0 (2022-03-22)

    Enhancements
    • None.
    Bug Fixes
    • Adds a check for command injections in the input for hg and git.
      orta #124

    1.5.1 (2021-09-07)

    Enhancements
    • None.

    ... (truncated)

    Commits
    • c03e2ed Release 1.6.3
    • f75bccc Disable Bazaar tests due to macOS 12.3 not including python2
    • 52a0d54 Merge pull request #128 from CocoaPods/validate_before_dl
    • d27c983 Ensure that the git pre-processor doesn't accidentally bail also
    • 3adfe1f [CHANGELOG] Add empty Master section
    • 591167a Release 1.6.2
    • d2564c3 Merge pull request #127 from CocoaPods/validate_before_dl
    • 99fec61 Switches where we check for invalid input, to move it inside the download fun...
    • 96679f2 [CHANGELOG] Add empty Master section
    • 3a7c54b Release 1.6.1
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(3.1.1)
  • 3.1.1(May 2, 2019)

  • 4.0.0(Apr 30, 2019)

    Released on 2019-04-30. All issues associated with this milestone can be found using this filter.

    Updated

    • The project to support Swift 5 only and no longer support Swift 4.2.
    • The deployment targerts to iOS 10.0, macOS 10.12, tvOS 10.0, and watchOS 3.0.
    Source code(tar.gz)
    Source code(zip)
  • 3.1.0(Apr 30, 2019)

  • 3.0.2(Sep 17, 2018)

    Released on 2018-09-17. All issues associated with this milestone can be found using this filter.

    Updated

    • The Xcode workspace to be compatible with Xcode 10 and Swift 4.2.
    • The podspec swift-version to 4.2.
    • The Travis-CI yaml file to build with Xcode 10 by leveraging bundler and a Gemfile.

    Fixed

    • Issue in the tests on iOS 8.4 by updating Travis to use newer OSX image.
    Source code(tar.gz)
    Source code(zip)
  • 3.0.1(Apr 10, 2018)

    Released on 2018-04-10. All issues associated with this milestone can be found using this filter.

    Updated

    • All the project copyright headers to use present language instead of end year.
    • The Xcode project, settings, and Travis-CI file to build and run against Xcode 9.3.
    • The podspec to directly specify swift_version and removed legacy .swift-version file.

    Fixed

    • An issue in Xcode 9.3 where NSNumber bridging for Float and Double is no longer implicit.
    Source code(tar.gz)
    Source code(zip)
  • 3.0.0(Aug 30, 2017)

  • 2.2.2(Aug 29, 2017)

    All issues associated with this milestone can be found using this filter.

    Added

    • New package file for Elevate to support the Swift Package Manager.

    Updated

    • The parseEntity behavior on Parser to allow custom Error types to be thrown without converting them into ParserError types.
    • The Xcode project and all schemes to Xcode 9.
    • All source and test code to compile against Swift 3.1 and 3.2.
    Source code(tar.gz)
    Source code(zip)
  • 2.2.1(Feb 9, 2017)

  • 2.2.0(Jan 14, 2017)

    All issues associated with this milestone can be found using this filter.

    Added

    • Decodable conformance for Dictionary types along with tests.

    Updated

    • Decodable test names, failure messages and general structure.
    • Primitive Decodable implementations by removing unnecessary toll-free bridging.
    • The Xcode project to Xcode 8.2 and disabled automatic signing for frameworks.
    • The project by refactoring OSX to macOS throughout along with the target names.
    • The travis yaml file to the xcode8.2 image and updated platforms and destinations.
    • The docstrings throughout codebase to use latest Xcode syntax.

    Fixed

    • Typo in primitive spelling throughout codebase...no breaking public API changes.
    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Nov 28, 2016)

    Added

    • The .swift-version file pointing at Swift 3.0 to support CocoaPods.
    • The Encodable protocol along with extensions for common types and unit tests.
    • The Encodable section to the README and updated Decodable to use KeyPath struct.

    Updated

    • The Person example to use an extension in the README.
    • Xcode project settings to latest defaults and disabled code signing.
    • Xcode project by disabling code signing on all targets and removed duplicate code signing identities.
    • Travis config to remove Slather due to test failures and added iOS 8.1 and 9.1 to device matrix.

    Fixed

    • Incorrect enum case in README for type arguments.
    • Issue where incorrect parameter name was used in multiple decoders section of the README.
    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(Sep 9, 2016)

    Added

    • An Elevate 2.0 Migration Guide detailing all breaking changes between 1.x and 2.0.

    Updated

    • All source, test and example logic and project settings to compile against Swift 3.0.
    • All protocols and implementations to use Any instead of AnyObject to match JSONSerialization API.
    • The Parser.parseObject API to be Elevate.decodeObject to add clarity for intended usage.
    • The Parser.parseArray API to be Elevate.decodeArray to add clarity for intended usage.
    • The 'Parser.parseProperties' API to be 'Parser.parseEntity' to add clarity for intended usage.
    • The ParserPropertyMaker and ParserProperty APIs to be Schema and SchemaProperty to add clarity for intended usage.
    • The 'propertyForKeyPath' API to be 'addProperty' to add clarity for intended usage.
    • The ParserPropertyType enum to be SchemaPropertyProtocol to adhere to Swift API Design Guidelines.
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Sep 8, 2016)

    Updated

    • All source, test and example logic to compile against Swift 2.3 and Xcode 8.
    • Dictionary key check from O(n) operation to O(1) resulting in overall parsing performance improvements of 40-50% in tests.
    • The Travis CI yaml file to build against iOS 10 and the new suite of simulators.

    Removed

    • Slather reporting from the test suite due to instability issues with Xcode and Travis CI.
    • CocoaPods linting from the Travis CI yaml file due to current instabilities with Xcode 8.
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Jun 27, 2016)

Owner
Nike Inc.
Nike Inc.
Ss-json - High-performance json parsing in swift

json 0.1.1 swift-json is a pure-Swift JSON parsing library designed for high-per

kelvin 43 Dec 15, 2022
Freddy - A reusable framework for parsing JSON in Swift.

Why Freddy? Parsing JSON elegantly and safely can be hard, but Freddy is here to help. Freddy is a reusable framework for parsing JSON in Swift. It ha

Big Nerd Ranch 1.1k Jan 1, 2023
HandyJSON is a framework written in Swift which to make converting model objects to and from JSON easy on iOS.

HandyJSON To deal with crash on iOS 14 beta4 please try version 5.0.3-beta HandyJSON is a framework written in Swift which to make converting model ob

Alibaba 4.1k Dec 29, 2022
Swift parser for JSON Feed — a new format similar to RSS and Atom but in JSON.

JSONFeed Swift parser for JSON Feed — a new format similar to RSS and Atom but in JSON. For more information about this new feed format visit: https:/

Toto Tvalavadze 31 Nov 22, 2021
JSEN (JSON Swift Enum Notation) is a lightweight enum representation of a JSON, written in Swift.

JSEN /ˈdʒeɪsən/ JAY-sən JSEN (JSON Swift Enum Notation) is a lightweight enum representation of a JSON, written in Swift. A JSON, as defined in the EC

Roger Oba 8 Nov 22, 2022
Networking, JSON Parsing, APIs and Core Location

Clima Our Goal It’s time to take our app development skills to the next level. We’re going to introduce you to the wonderful world of Application Prog

Dessana Caldeira M. Santos 1 Nov 25, 2021
📱 A comprehensive test task for creating an autolayout interface, requesting an API and JSON parsing from Effective Mobile.

ECOMMERCE A comprehensive test task for creating an autolayout interface, requesting an API and JSON parsing from Effective Mobile. ??‍?? Design ✨ Fea

Daniel Tvorun 4 Nov 21, 2022
[Deprecated] A shiny JSON parsing library in Swift :sparkles: Loved by many from 2015-2021

?? Deprecation Notice ?? Gloss has been deprecated in favor of Swift's Codable framework. The existing Gloss source is not going away, however updates

Harlan Kellaway 1.6k Nov 24, 2022
Precise JSON decimal parsing for Swift 🧮

PreciseDecimal Introduction Swift has long suffered a problem with its Decimal type: unapparent loss of precision. This happens with all common ways o

David Roman 22 Dec 15, 2022
Developed with use Swift language. As a third party library used SDWebImage. JSON parsing using URLSession with TMDB API. This app provide by the Core Data structure.

Capstone Project ?? About Developed with use Swift language. As a third party library used SDWebImage. JSON parsing using URLSession with TMDB API. Ad

Ensar Batuhan Unverdi 9 Aug 22, 2022
JSON-Practice - JSON Practice With Swift

JSON Practice Vista creada con: Programmatic + AutoLayout Breve explicación de l

Vanesa Giselle Korbenfeld 0 Oct 29, 2021
JSONNeverDie - Auto reflection tool from JSON to Model, user friendly JSON encoder / decoder, aims to never die

JSONNeverDie is an auto reflection tool from JSON to Model, a user friendly JSON encoder / decoder, aims to never die. Also JSONNeverDie is a very important part of Pitaya.

John Lui 454 Oct 30, 2022
JSONHelper - ✌ Convert anything into anything in one operation; JSON data into class instances, hex strings into UIColor/NSColor, y/n strings to booleans, arrays and dictionaries of these; anything you can make sense of!

JSONHelper Convert anything into anything in one operation; hex strings into UIColor/NSColor, JSON strings into class instances, y/n strings to boolea

Baris Sencan 788 Jul 19, 2022
A fast, convenient and nonintrusive conversion framework between JSON and model. Your model class doesn't need to extend any base class. You don't need to modify any model file.

MJExtension A fast, convenient and nonintrusive conversion framework between JSON and model. 转换速度快、使用简单方便的字典转模型框架 ?? ✍??Release Notes: more details Co

M了个J 8.5k Jan 3, 2023
ObjectMapper is a framework written in Swift that makes it easy for you to convert your model objects to and from JSON.

ObjectMapper is a framework written in Swift that makes it easy for you to convert your model objects (classes and structs) to and from J

Tristan Himmelman 9k Jan 2, 2023
Swift/Obj-C HTTP framework with a focus on REST and JSON

Now Archived and Forked PMHTTP will not be maintained in this repository going forward. Please use, create issues on, and make PRs to the fork of PHMT

Postmates Inc. 509 Sep 4, 2022
This framework implements a strict JSON parser and generator in Objective-C.

SBJson 5 Chunk-based JSON parsing and generation in Objective-C. Overview SBJson's number one feature is stream/chunk-based operation. Feed the parser

null 3.8k Jan 5, 2023
Magical Data Modeling Framework for JSON - allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS and tvOS apps.

JSONModel - Magical Data Modeling Framework for JSON JSONModel allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS

JSONModel 6.9k Dec 8, 2022
Magical Data Modeling Framework for JSON - allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS and tvOS apps.

JSONModel - Magical Data Modeling Framework for JSON JSONModel allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS

JSONModel 6.8k Nov 19, 2021