# Code components

# Ajv classes

lib/core.ts (opens new window) - core Ajv class without any keywords. All Ajv methods for managing schemas and extensions are defined in this class.

lib/ajv.ts (opens new window) - subclass of Ajv core with JSON Schema draft-07 keywords.

lib/2019.ts (opens new window) - subclass of Ajv core with JSON Schema draft-2019-09 keywords.

lib/jtd.ts (opens new window) - subclass of Ajv core with JSON Type Definition support.

# Schema compilation

lib/compile (opens new window) - code for schema compilation

lib/compile/index.ts (opens new window) - the main recursive function code for schema compilation, functions for reference resolution, the interface for schema compilation context (SchemaCxt).

lib/compile/context.ts (opens new window) - the class for keyword code generation KeywordCxt. All pre-defined keywords and user-defined keywords that use code function are passed an instance of this class.

lib/compile/rules.ts (opens new window) - data structure to store references to all all keyword definitions that were added to Ajv instance, organised by data type.

lib/compile/subschema.ts (opens new window) - creates schema context (SchemaCxt) to generate code for subschemas - used by all applicator keywords in lib/vocabularies/applicator (opens new window).

lib/compile/codegen (opens new window) - the api for code generation.

lib/compile/validate (opens new window) - code to iterate the schema to generate code of validation function.

# Other components

lib/standalone (opens new window) - module to generate standalone validation code.

lib/vocabularies (opens new window) - pre-defined validation keywords.

lib/refs (opens new window) - JSON Schema meta-schemas.