JSONifiable
public protocol JSONifiable
A type that can be represented as JSON
-
toJSONDictionary()
Default implementationProduce a JSON serializable dictionary that represents the type
Default Implementation
If the type is a
struct
, produce a JSON serializable dictionary that represents thestruct
Declaration
Swift
func toJSONDictionary() -> [String : Any]
-
toJSONString()
Default implementationSerialize the type to a pretty-printed JSON string
Default Implementation
Serialize the type to a pretty-printed JSON string
Declaration
Swift
func toJSONString() -> String