ExtendedJSONDecoder

public class ExtendedJSONDecoder

ExtendedJSONDecoder facilitates the decoding of ExtendedJSON into Decodable values.

  • Contextual user-provided information for use during decoding.

    Declaration

    Swift

    public var userInfo: [CodingUserInfoKey : Any]
  • Initialize an ExtendedJSONDecoder.

    Declaration

    Swift

    public init()
  • Decodes an instance of the requested type T from the provided extended JSON data.

    Throws

    DecodingError if the JSON data is corrupt or if any value throws an error during decoding.

    Declaration

    Swift

    public func decode<T>(_: T.Type, from data: Data) throws -> T where T : Decodable

    Parameters

    type

    Codable type to decode the input into.

    data

    Data which represents the JSON that will be decoded.

    Return Value

    Decoded representation of the JSON input as an instance of T.

  • Decodes an instance of the requested type T from the provided extended JSON data.

    Throws

    DecodingError if the JSON data is corrupt or if any value throws an error during decoding.

    Declaration

    Swift

    public func decode<T>(_: T.Type, from buffer: ByteBuffer) throws -> T where T : Decodable

    Parameters

    type

    Codable type to decode the input into.

    buffer

    ByteBuffer which contains the JSON data that will be decoded.

    Return Value

    Decoded representation of the JSON input as an instance of T.