Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 1.3 KB

anchor.md

File metadata and controls

45 lines (28 loc) · 1.3 KB

Anchor Object

An Anchor object represents a JSON Schema anchor (i.e. $anchor) in a resource.

TIP: Read Understanding Schema Structure to learn how all the different objects in our object model are related.

Source Code

You can view the source code for the JsonSchema object here.

Properties

This is the JsonSchema object that contains this anchor.

if (anchor.schema.rootResource === anchor.resource) {
  console.log("This anchor is in the root resource of the schema");
}

This is the File object that contains this anchor.

console.log(`This anchor is in ${anchor.file.path}`);

resource (Resource object)

This is the Resource object that contains this anchor.

console.log(`This anchor is in ${anchor.resource.uri.href}`);

⚠ INCOMPLETE DOCS ⚠

There's more to this object, but the rest of this page has not yet been written.