Return ajv errors from validate method.

This commit is contained in:
Austin Smith
2025-11-19 08:33:39 -05:00
parent c8d52f15cc
commit 4d1a652e84
2 changed files with 3 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ import Ajv, { type ValidateFunction } from 'ajv';
import addFormats from 'ajv-formats';
const ajv = new Ajv({
allErrors: true,
coerceTypes: true,
});
addFormats(ajv);
@@ -239,7 +240,7 @@ export class Declaform extends HTMLElement {
}
const obj = this.toObject();
const isValid = this._validate(obj);
return isValid;
return this._validate.errors;
}
private async hydrateFromEndpoint(endpoint: string): Promise<void> {