JSON (RFC 7159) for Swift 2.2 on Linux
Switch branches/tags
Clone or download
Pull request Compare This branch is 3 commits ahead, 39 commits behind ZewoGraveyard:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Sources
Tests
.gitignore
LICENSE
Makefile
Package.swift
README.md

README.md

JSON

JSON is a fork of JSON by Zewo that allows custom types to be serialized using the JSONEncodable protocol.

Usage

import JSON

// parse JSON string

let json = try! JSONParser.parse("{\"foo\":\"bar\"}")

let json: JSON = [
    "null": nil,
    "string": "Foo Bar",
    "boolean": true,
    "array": [
        "1",
        2,
        nil,
        true,
        ["1", 2, nil, false],
        ["a": "b"]
    ],
    "object": [
        "a": "1",
        "b": 2,
        "c": nil,
        "d": false,
        "e": ["1", 2, nil, false],
        "f": ["a": "b"]
    ],
    "number": 1969
]

Installation

  • Add JSON to your Package.swift
import PackageDescription

let package = Package(
    dependencies: [
        .Package(url: "https://github.com/DanielTomlinson/JSON.git", majorVersion: 0, minor: 4)
    ]
)

License

JSON is released under the MIT license. See LICENSE for details.