SmartJSONDecoder

open class SmartJSONDecoder : JSONDecoder, @unchecked Sendable

Undocumented

Decoding Values

  • Decodes a top-level value of the given type from the given JSON representation.

    Throws

    DecodingError.dataCorrupted if values requested from the payload are corrupted, or if the given data is not valid JSON.

    Throws

    An error if any value throws an error during decoding.

    Declaration

    Swift

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

    Parameters

    type

    The type of the value to decode.

    data

    The data to decode from.

    Return Value

    A value of the requested type.