KeyedDecodingContainer

public extension KeyedDecodingContainer
  • Caches a link to be resolved once all resources in the response have been serialized.

    Throws

    Forwards the error if no link object is in the JSON at the specified key.

    Declaration

    Swift

    func resolveLink(forKey key: KeyedDecodingContainer.Key,
                     decoder: Decoder,
                     callback: @escaping (AnyObject) -> Void) throws

    Parameters

    key

    The KeyedDecodingContainer.Key representing the JSON key where the related resource is found.

    decoder

    The Decoder being used to deserialize the JSON to user-defined classes.

    callback

    The callback used to assign the linked item at a later time.

  • Caches an array of linked resources to be resolved once all resources in the response have been deserialized.

    Throws

    Forwards the error if no link object is in the JSON at the specified key.

    Declaration

    Swift

    func resolveLinksArray(forKey key: KeyedDecodingContainer.Key,
                           decoder: Decoder,
                           callback: @escaping (AnyObject) -> Void) throws

    Parameters

    key

    The KeyedDecodingContainer.Key representing the JSON key where the related resources are found.

    decoder

    The Decoder being used to deserialize the JSON to user-defined classes.

    callback

    The callback used to assign the linked items at a later time.