Swift wrapper around Foundation.JSON (previously NSJSON).
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
let serialized = "{\"hello\":\"world\"}"
let json = try JSON(bytes: string.bytes)
JSON is NodeConvertible
which means it can be easily converted to any other model that supports Node.
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 |
Visit the Vapor web framework's documentation for instructions on how to install Swift 3.
We pride ourselves on providing a diverse and welcoming community. Join your fellow Vapor developers in our slack and take part in the conversation.
Node has been tested on OS X 10.11, Ubuntu 14.04, and Ubuntu 15.10.