Skip to content

Commit

Permalink
doc: document variables referencing schemas in code
Browse files Browse the repository at this point in the history
  • Loading branch information
ChALkeR committed Nov 30, 2023
1 parent e3224b1 commit faddd1e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ const generateMeta = (root, $schema, enforce, requireSchema) => {
}
}

/*
Variables referencing schemas:
1. `root` -- top-level schema, entry point
2. `schema` -- portion of the schema currently being compiled to a separate function,
i.e. top-level or referenced ($ref/etc)
3. `node` (defined in visit()) -- schema object being visited by visit()
4. `schemas` aka `opts.schemas` -- a Map() of sibling schemas that could be referenced by
their $id (and optionally subreferenced via json pointer path)
*/

const compileSchema = (schema, root, opts, scope, basePathRoot = '') => {
const {
mode = 'default',
Expand Down

0 comments on commit faddd1e

Please sign in to comment.