测试已测试 | ✓ |
语言语言 | SwiftSwift |
许可证 | Apache 2 |
发布最后发布 | 2016年1月 |
SPM支持 SPM | ✗ |
由 Logan Wright 维护。
A pure-Swift JSON serializer and deserializer.
import PureJsonSerializer
// parse a JSON data
let data: NSData = ...
do {
let json = try Json.deserialize(jsonSource)
let value = json["Foo"]?["bar"]?.stringValue ?? ""
print(value)
} catch {
print("Json serialization failed with error: \(error)")
}
// build a JSON structure
let profile: Json = [
"name": "Swift",
"started": 2014,
"keywords": ["OOP", "functional programming", "static types", "iOS"],
]
println(profile.description) // packed JSON string
println(profile.debugDescription) // pretty JSON string
let serializedJson = json.serialize(.PrettyPrint)
Swift-JsonSerializer 是一个纯 Swift 实现的 JSON 序列化和反序列化库,不对 Swift 的内置/标准类添加任何内容。
此库特性可在您在此处找到的完整 Json 映射库中找到:这里。
swiftc -O
)一起工作。Fuji, Goro (gfx) [email protected]
The Apache 2.0 License