refactor: update all

This commit is contained in:
openstappsbot
2021-09-28 13:14:12 +00:00
committed by Rainer Killinger
parent 9bc05d2c99
commit 8cf40900bb
4 changed files with 267 additions and 366 deletions

View File

@@ -39,7 +39,7 @@ export class Converter {
/**
* Schema validator instance
*/
private readonly schemaValidator: Ajv.Ajv;
private readonly schemaValidator: Ajv;
/**
* Create a new converter

View File

@@ -31,7 +31,7 @@ export class Validator {
/**
* JSON Schema Validator
*/
private readonly ajv = Ajv({verbose: true, jsonPointers: true, extendRefs: true});
private readonly ajv = new Ajv({verbose: true});
/**
* Map of schema names to schemas
@@ -127,7 +127,7 @@ function fromAjvResult(
result: boolean | PromiseLike<unknown>,
schema: JSONSchema7,
instance: unknown,
ajvInstance: Ajv.Ajv,
ajvInstance: Ajv,
): ValidationResult {
// @ts-expect-error function can return void, which at runtime will be undefined. TS doesn't allow to assign void to undefined
const betterErrorObject: betterAjvErrors.IOutputError[] | undefined = betterAjvErrors(
@@ -142,7 +142,7 @@ function fromAjvResult(
errors:
ajvInstance.errors?.map((ajvError, index) => {
const error: ValidationError = {
dataPath: ajvError.dataPath,
dataPath: ajvError.instancePath,
instance: instance,
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
message: betterErrorObject?.[index].error!,