@apideck/better-ajv-errors
Version:
Human-friendly JSON Schema validation for APIs
11 lines (10 loc) • 418 B
TypeScript
import { ErrorObject } from 'ajv';
import { ValidationError } from './types/ValidationError';
export interface BetterAjvErrorsOptions<S = any> {
errors: ErrorObject[] | null | undefined;
data: any;
schema: S;
basePath?: string;
}
export declare const betterAjvErrors: <S = any>({ errors, data, schema, basePath, }: BetterAjvErrorsOptions<S>) => ValidationError[];
export { ValidationError };