JSONValue

@dynamicMemberLookup
public enum JSONValue
extension JSONValue: Codable
extension JSONValue: Equatable
extension JSONValue: ExpressibleByArrayLiteral
extension JSONValue: ExpressibleByBooleanLiteral
extension JSONValue: ExpressibleByDictionaryLiteral
extension JSONValue: ExpressibleByFloatLiteral
extension JSONValue: ExpressibleByIntegerLiteral
extension JSONValue: ExpressibleByNilLiteral
extension JSONValue: ExpressibleByStringLiteral

A utility type that allows us to represent an arbitrary JSON structure

  • Declaration

    Swift

    case array([JSONValue])
  • Declaration

    Swift

    case boolean(Bool)
  • Declaration

    Swift

    case number(Double)
  • Declaration

    Swift

    case object([String : JSONValue])
  • Declaration

    Swift

    case string(String)
  • Declaration

    Swift

    case null
  • Declaration

    Swift

    func value(at keyPath: String) -> JSONValue?
  • Declaration

    Swift

    func value<T: StringProtocol>(at keyPath: String,
                                  separatedBy separator: T) -> JSONValue?
  • Declaration

    Swift

    func value(at keyPath: String, withDefault defaultValue: JSONValue) -> JSONValue
  • Declaration

    Swift

    subscript(key: String) -> JSONValue? { get }
  • Declaration

    Swift

    subscript(key: Int) -> JSONValue? { get }
  • Declaration

    Swift

    subscript(dynamicMember member: String) -> JSONValue? { get }
  • Declaration

    Swift

    public init(from decoder: Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Declaration

    Swift

    public init(arrayLiteral elements: JSONValue...)
  • Declaration

    Swift

    public init(booleanLiteral value: Bool)
  • Declaration

    Swift

    public init(dictionaryLiteral elements: (String, JSONValue)...)
  • Declaration

    Swift

    public init(floatLiteral value: Double)
  • Declaration

    Swift

    public init(integerLiteral value: Int)
  • Declaration

    Swift

    public init(nilLiteral: ())
  • Declaration

    Swift

    public init(stringLiteral value: String)
  • Declaration

    Swift

    public var asObject: [String : JSONValue]? { get }
  • Declaration

    Swift

    public var asArray: [JSONValue]? { get }
  • Declaration

    Swift

    public var stringValue: String? { get }
  • Declaration

    Swift

    public var intValue: Int? { get }
  • Declaration

    Swift

    public var doubleValue: Double? { get }
  • Declaration

    Swift

    public var booleanValue: Bool? { get }
  • Declaration

    Swift

    public var isNull: Bool { get }