-
Create a JSON Array of models.
Declaration
Swift
func makeJSON(_ number: Int) -> [[String : Any]]Parameters
numberthe number of JSON Object to make.
-
makeJSON(from:Default implementation) Create a JSON Array from a sequence of models.
Default Implementation
Create a JSON Object from a model.
Declaration
Swift
func makeJSON<S>(from objects: S) -> [[String : Any]] where S : Sequence, Self.Model == S.ElementParameters
objectsthe sequence to use.
-
Create an array of both model and its relative JSON Object.
Declaration
Swift
func makeWithJSON(_ number: Int) -> [(object: Model, JSON: [String : Any])]Parameters
numberthe number of JSON Object/Model to make.
-
makeJSON()Extension methodCreate a JSON Object.
Declaration
Swift
public func makeJSON() -> [String : Any]Return Value
a JSON Object.
-
makeWithJSON()Extension methodCreate a tuple of model and its relative JSON Object.
Declaration
Swift
public func makeWithJSON() -> (object: Model, JSON: [String : Any])Return Value
the tuple of model + JSON Object.
View on GitHub
Install in Dash
JSONFixtureMaker Protocol Reference