Closed ShaharHD closed 5 years ago
Gives out an error:
error: uncaughtException: can't resolve reference http://json-schema.org/draft-06/schema#
Using the library in TypeScript v2.5
the following code produce the error:
import * as Ajv from 'ajv'; import * as AjvAsync from 'ajv-async'; import * as AjvKeywords from 'ajv-keywords'; import * as AjvMergePatch from 'ajv-merge-patch'; export const ajv = AjvAsync(new Ajv({ coerceTypes: 'array', jsonPointers: true, allErrors: true, $data: true, removeAdditional: true, })); AjvMergePatch(ajv); AjvKeywords(ajv);
To work around you can just add meta-schema for draft-06. See https://github.com/epoberezkin/ajv#using-version-6
Gives out an error:
Using the library in TypeScript v2.5
the following code produce the error: