schema-components - v3.7.0
    Preparing search index...

    Function dereference

    • Dereference a JSON Pointer fragment (#/path/to/schema) or an $anchor (#SomeName) against a root document.

      Returns the resolved sub-schema, which may be a JSON object or — per Draft 06+ — a boolean (true for the always-valid schema, false for the never-valid schema). Returns undefined when the pointer or anchor cannot be resolved.

      JSON Pointer segments are percent-decoded per RFC 6901 §6 before the ~1/~0 token expansion; this allows pointers such as #/paths/~1pets%20store to resolve a path containing a literal space.

      Parameters

      • ref: string
      • root: Record<string, unknown>

      Returns boolean | Record<string, unknown> | undefined