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

23 lines (22 loc) 723 B
import type { ValidatorPlugin } from '@canard/schema-form'; /** * AJV8 validator plugin for schema-form. * * This plugin provides JSON Schema validation using AJV version 8.x. * Unlike AJV6, AJV8 already uses JSONPointer format for error dataPaths, * so no path transformation is needed. * * @example * ```typescript * import { ajvValidatorPlugin } from '@canard/schema-form-ajv8-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;