JSONDecodable

public protocol JSONDecodable

A protocol to provide functionality for creating a model object with a JSON value.

  • Creates an instance of the model with a JSON instance. - parameter json: An instance of a JSON value from which to construct an instance of the implementing type. - throws: Any JSON.Error for errors derived from inspecting the JSON value, or any other error involved in decoding.

    Declaration

    Swift

    init(json: JSON) throws

    Parameters

    json

    An instance of a JSON value from which to construct an instance of the implementing type.