JSONValue is a Swift Package for encoding, decoding, and constructing
arbitrary JSON values without a fixed Codable model.
import Foundation
import JSONValue
let value: JSONValue = [
"id": 42,
"name": "Ada",
"active": true,
"rating": 4.5,
"tags": ["swift", nil]
]
let name = value["name"]
let firstTag = value["tags"]?[0]
let active = value.active
let data = try JSONEncoder().encode(value)
let decoded = try JSONDecoder().decode(JSONValue.self, from: data).package(url: "https://github.com/inekipelov/swift-json-value.git", from: "1.0.0")