• replaces $ref's within a document and its schemas. The replaced value will be a javascript object reference to the real schema / open-rpc component

    Parameters

    • openrpcDocument: OpenrpcDocument
    • resolver: default = referenceResolver

    Returns Promise<OpenRPC>

    The same OpenRPC Document that was passed in, but with all $ref's dereferenced.

    Throws

    [[OpenRPCDocumentDereferencingError]]

    Example


    import { OpenRPC } from "@open-rpc/meta-schema"
    import { dereferenceDocument } from "@open-rpc/schema-utils-js";

    try {
    const dereffedDocument = await dereferenceDocument({ ... }) as OpenRPC;
    } catch (e) {
    // handle validation errors
    }