Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/web3-validator/src/web3_validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ export class Web3Validator {
]);
}

if (!this._validator.validate(jsonSchema, data)) {
const schemaKey = JSON.stringify(jsonSchema);
if (!this._validator.getSchema(schemaKey)) {
this._validator.addSchema(jsonSchema, schemaKey);
}
if (!this._validator.validate(schemaKey, data)) {
const errors = this._validator.errors as Web3ValidationErrorObject[];

if (options?.silent) {
Expand Down