UNPKG

@canard/schema-form-ajv8-plugin

Version:

AJV 8.x validator plugin for @canard/schema-form providing JSON Schema validation with latest Draft 2020-12 and Draft 2019-09 support

14 lines (13 loc) 631 B
import type { JsonSchema, ValidateFunction } from '@canard/schema-form'; import type Ajv from 'ajv'; /** * Creates a validator factory function for AJV8. * * This factory function creates validators that transform AJV8 errors to match * the schema-form library's error format. Since AJV8 already uses JSONPointer * format for dataPaths, only basic error transformation is needed. * * @param ajv - The AJV8 instance to use for validation * @returns A factory function that creates validators for given JSON schemas */ export declare const createValidatorFactory: (ajv: Ajv) => (jsonSchema: JsonSchema) => ValidateFunction;