SmartJSONEncoder

open class SmartJSONEncoder : JSONEncoder, @unchecked Sendable

Undocumented

Encoding Values

  • Encodes the given top-level value and returns its JSON representation.

    Throws

    EncodingError.invalidValue if a non-conforming floating-point value is encountered during encoding, and the encoding strategy is .throw.

    Throws

    An error if any value throws an error during encoding.

    Declaration

    Swift

    override open func encode<T>(_ value: T) throws -> Data where T : Encodable

    Parameters

    value

    The value to encode.

    Return Value

    A new Data value containing the encoded JSON data.