UNPKG

@canard/schema-form-ajv7-plugin

Version:

AJV 7.x validator plugin for @canard/schema-form providing JSON Schema validation with Draft-07 and Draft 2019-09 support

23 lines (22 loc) 744 B
import type { ValidatorPlugin } from '@canard/schema-form'; /** * AJV7 validator plugin for schema-form. * * This plugin provides JSON Schema validation using AJV version 7.x. * AJV7 uses JSONPointer format for error instancePaths by default, * which provides better consistency with the schema-form library. * * @example * ```typescript * import { ajvValidatorPlugin } from '@canard/schema-form-ajv7-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;