Creates a new validator instance.
Registers a JSON Schema with a unique name.
The schema will be compiled and cached for later validation.
The unique identifier for the schema.
The JSON Schema object.
This validator for method chaining.
Validates data against a JSON Schema, acting as a type assertion.
On failure, it throws a detailed validation error.
The expected type after validation.
The name of the schema to validate against.
The data to be validated.
ValidatorError If validation fails, containing detailed error information.
Validates data against a JSON Schema, acting as a type guard.
On success, it narrows the type of the data to the specified type T.
The expected type after validation.
The name of the schema to validate against.
The data to be validated.
true if the data is valid, false otherwise.
StaticregisterRegisters the validator as a singleton in the DI container.
The DI container to register in.
Ajv-based validator implementation.
Provides thread-safe JSON Schema validation with comprehensive error reporting. Uses the Ajv library as the underlying validation engine.
See
https://ajv.js.org/ - Ajv documentation
Example