JSONifiable

public protocol JSONifiable

A type that can be represented as JSON

  • toJSONDictionary() Default implementation

    Produce a JSON serializable dictionary that represents the type

    Default Implementation

    If the type is a struct, produce a JSON serializable dictionary that represents the struct

    Declaration

    Swift

    func toJSONDictionary() -> [String : Any]
  • toJSONString() Default implementation

    Serialize the type to a pretty-printed JSON string

    Default Implementation

    Serialize the type to a pretty-printed JSON string

    Declaration

    Swift

    func toJSONString() -> String