FailableJSONRepresentable

public protocol FailableJSONRepresentable

A type that can be converted to a JSON instance, with potential errors.

  • failableJSON() Default implementation

    Gets the JSON representation of the instance.

    Throws

    Failures to convert one of the instance’s values to a JSON representation.

    Default Implementation

    The default implementation of FailableJSONRepresentable.failableJSON() for type that conform to SafeJSONRepresentable.

    Throws

    This implementation never throws.

    Declaration

    Swift

    func failableJSON() throws -> JSON

    Return Value

    The JSON structure that represents the instance.