Decodable

extension Decodable
  • Initializes an instance of Self from a JSON instance using JSONCoder.

    Throws

    Decoding errors that occur when decoding JSON to Self.

    Declaration

    Swift

    public init(json: JSON) throws

    Parameters

    json

    The JSON to create an instance of Self from.

  • Initializes an instance of Self from a JSON instance using JSONCoder.

    Returns nil if nil is passed in.

    Throws

    Decoding errors that occur when decoding JSON to Self.

    Declaration

    Swift

    public init?(json: JSON?) throws

    Parameters

    json

    The JSON to create an instance of Self from.