UNPKG

@canard/schema-form-ajv6-plugin

Version:

AJV 6.x validator plugin for @canard/schema-form providing JSON Schema validation with legacy Draft-04, Draft-06, and Draft-07 support

23 lines (22 loc) 748 B
import type { ValidatorPlugin } from '@canard/schema-form'; /** * AJV6 validator plugin for schema-form. * * This plugin provides JSON Schema validation using AJV version 6.x. * It automatically converts AJV6's JSONPath format error dataPaths to * JSONPointer format for consistency with the schema-form library. * * @example * ```typescript * import { ajvValidatorPlugin } from '@canard/schema-form-ajv6-plugin'; * * // Use with custom AJV instance * const customAjv = new Ajv({ allErrors: false }); * ajvValidatorPlugin.bind(customAjv); * * // Compile a validator * const validator = ajvValidatorPlugin.compile(schema); * const errors = await validator(data); * ``` */ export declare const ajvValidatorPlugin: ValidatorPlugin;