mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 16:42:56 +00:00
refactor: update all
This commit is contained in:
committed by
Rainer Killinger
parent
9bc05d2c99
commit
8cf40900bb
@@ -39,7 +39,7 @@ export class Converter {
|
||||
/**
|
||||
* Schema validator instance
|
||||
*/
|
||||
private readonly schemaValidator: Ajv.Ajv;
|
||||
private readonly schemaValidator: Ajv;
|
||||
|
||||
/**
|
||||
* Create a new converter
|
||||
|
||||
@@ -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!,
|
||||
|
||||
Reference in New Issue
Block a user