Creates a new validator instance.
Register multiple schemas in bulk.
Dictionary mapping schema names to schema objects
Strict validation using assertion.
Throws ValidatorError with detailed validation errors on failure. Use this for critical validation in request/response processing.
Expected data type after validation
Schema name to validate against
Unknown data to validate
ValidatorError with validation error details
Retrieve a registered JSON schema by name.
The schema identifier
Schema object, or undefined if not found
Type-safe validation using type guard.
Returns false instead of throwing on validation failure. Use this for non-critical validation.
Expected data type after validation
Schema name to validate against
Unknown data to validate
true if data matches schema (and narrows type to T)
StaticregisterRegister validator instance as singleton in DI container.
DI container to register in
Ajv-based validator implementation.
Provides thread-safe schema validation with comprehensive error reporting. Uses Ajv with strict configuration for production use.
Example
See
https://ajv.js.org/ - Ajv documentation