github.com/github.com/vapor/json

Convenience wrapper for Foundation JSON.


Keywords
json, swift, vapor
License
MIT

Documentation

JSON

Swift wrapper around Foundation.JSON (previously NSJSON).

Swift Build Status Code Coverage Codebeat Slack Status

Serialization

let json = try JSON([
    "null": nil,
    "bool": false,
    "string": "ferret 🚀",
    "int": 42,
    "double": 3.14159265358979,
    "object": JSON([
        "nested": "text"
    ]),
    "array": JSON([nil, true, 1337, "😄"])
])

let serialized = try json.makeBytes().string

Parsing

let serialized = "{\"hello\":\"world\"}"
let json = try JSON(bytes: string.bytes)

⛓ Node

JSON is NodeConvertible which means it can be easily converted to any other model that supports Node.

🌏 Environment

JSON Xcode Swift
0.2.x 8.0 Beta 3 DEVELOPMENT-SNAPSHOT-2016-07-25-a
0.1.x 8.0 Beta 3 DEVELOPMENT-SNAPSHOT-2016-07-20-qutheory

📖 Documentation

Visit the Vapor web framework's documentation for instructions on how to install Swift 3.

💧 Community

We pride ourselves on providing a diverse and welcoming community. Join your fellow Vapor developers in our slack and take part in the conversation.

🔧 Compatibility

Node has been tested on OS X 10.11, Ubuntu 14.04, and Ubuntu 15.10.