CodableModel

public protocol CodableModel

Helper providing informations to sucessfully encode/decode each model. Each CoinapaprikaAPI Model conforms to this protocol. Use decoder/encoder properties if you want to store our models.

  • decoder Default implementation

    JSONDecoder ready to decode the model.

    Default Implementation

    Declaration

    Swift

    static var decoder: JSONDecoder { get }
  • encoder Default implementation

    JSONDecoder ready to encode the model.

    Default Implementation

    Declaration

    Swift

    static var encoder: JSONEncoder { get }
  • keyDecodingStrategy Default implementation

    KeyDecodingStrategy for JSONDecoder, typically our custom snake_case to camelCase decoder. Use it only if you want to build your own decoder.

    Default Implementation

    Declaration

    Swift

    static var keyDecodingStrategy: JSONDecoder.KeyDecodingStrategy? { get }
  • keyEncodingStrategy Default implementation

    KeyEncodingStrategy for JSONEncoder, typically it’s nil - we are storing properties names as camelCase without transforming. Use it only if you want to build your own encoder.

    Default Implementation

    Declaration

    Swift

    static var keyEncodingStrategy: JSONEncoder.KeyEncodingStrategy? { get }
  • dateDecodingStrategy Default implementation

    DateDecodingStrategy for JSONDecoder, it could be either iso8601 or unix timestamp. Use it only if you want to build your own decoder.

    Default Implementation

    Declaration

    Swift

    static var dateDecodingStrategy: JSONDecoder.DateDecodingStrategy? { get }
  • dateEncodingStrategy Default implementation

    DateEncodingStrategy for JSONEncoder, it could be either iso8601 or unix timestamp. Use it only if you want to build your own encoder.

    Default Implementation

    Declaration

    Swift

    static var dateEncodingStrategy: JSONEncoder.DateEncodingStrategy? { get }