Skip to content

Commit

Permalink
debug: logging parse in ajv
Browse files Browse the repository at this point in the history
Signed-off-by: Tokesh <[email protected]>
  • Loading branch information
Tokesh committed Jan 18, 2025
1 parent 4bf440f commit 2c3c787
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions tools/src/_utils/AjvErrorsParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ export default class AjvErrorsParser {
}

parse(errors: ErrorObject[] | undefined | null): string {
const error_groups = this.#group_errors(errors ?? [])
console.log('Raw errors:', errors); // Логируем все ошибки

Check failure on line 30 in tools/src/_utils/AjvErrorsParser.ts

View workflow job for this annotation

GitHub Actions / lint

Unknown word: "Логируем"

Check failure on line 30 in tools/src/_utils/AjvErrorsParser.ts

View workflow job for this annotation

GitHub Actions / lint

Unknown word: "ошибки"
const error_groups = this.#group_errors(errors ?? []);
const parsed_errors = [
this.#prohibited_property_error(error_groups.prohibited),
this.#required_property_error(error_groups.required),
this.#enum_error(error_groups.enum),
...error_groups.others
].filter(e => e != null) as ErrorObject[]
return this.ajv.errorsText(parsed_errors, this.options)
}
].filter(e => e != null) as ErrorObject[];
console.log('Parsed errors:', parsed_errors); // Логируем после обработки

Check failure on line 38 in tools/src/_utils/AjvErrorsParser.ts

View workflow job for this annotation

GitHub Actions / lint

Unknown word: "Логируем"

Check failure on line 38 in tools/src/_utils/AjvErrorsParser.ts

View workflow job for this annotation

GitHub Actions / lint

Unknown word: "после"

Check failure on line 38 in tools/src/_utils/AjvErrorsParser.ts

View workflow job for this annotation

GitHub Actions / lint

Unknown word: "обработки"
return this.ajv.errorsText(parsed_errors, this.options);
}

Check failure on line 40 in tools/src/_utils/AjvErrorsParser.ts

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces not allowed

#group_errors(errors: ErrorObject[]): GroupedErrors {
const categories = {
Expand Down
1 change: 0 additions & 1 deletion tools/src/_utils/JsonSchemaValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default class JsonSchemaValidator {
}
})
this.errors_parser = new AjvErrorsParser(this.ajv, options.errors_text_opts)
console.log("default_schema", JSON.stringify(default_schema))
if (default_schema) this._validate = this.ajv.compile(default_schema)
}

Expand Down

0 comments on commit 2c3c787

Please sign in to comment.