JSONEncodable

public protocol JSONEncodable

A protocol to facilitate encoding and decoding of JSON.

  • Converts an instance of a conforming type to JSON. - returns: An instance of JSON. - Note: If conforming to JSONEncodable with a custom type of your own, you should return an instance of JSON.dictionary.

    Declaration

    Swift

    func toJSON() -> JSON

    Return Value

    An instance of JSON.