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 aJSON
value from which to construct an instance of the implementing type. - throws: AnyJSON.Error
for errors derived from inspecting theJSON
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.