Protocols

The following protocols are available globally.

  • A protocol for types that can deserialize JSON.

    All methods have default implementations. See JSONDeserializer‘s extensions for details.

    See more

    Declaration

    Swift

    public protocol JSONDeserializer
  • A protocol for types that deserialize themselves from JSON.

    Helps reduces boilerplate for types that deserialize themselves from a single source type. Using this protocol you only have to:

    • specify the JSONRepresentation type
    • implement init(jsonData:)

    For an example, see UsageTests.swift.

    See more

    Declaration

    Swift

    public protocol JSONRepresentable: JSONDeserializer
  • Implemented by Foundation types returned by JSONSerialization.jsonObject(with:options:):

    • NSArray
    • NSDictionary
    • NSNull
    • NSNumber
    • NSString

    Declaration

    Swift

    public protocol JSONAnyParsedObject