diff --git a/CHANGELOG.md b/CHANGELOG.md index 62d7ba6cb4..78437d56c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,10 @@ should change the heading of the (upcoming) version to include a major version b - Fixed issue with formData not updating when dependencies change, fixing [#4325](https://github.com/rjsf-team/react-jsonschema-form/issues/4325) - Fixed issue with assigning default values to formData with deeply nested required properties, fixing [#4399](https://github.com/rjsf-team/react-jsonschema-form/issues/4399) +## @rjsf/validator-ajv8 + +- Switched uses of `lodash.isEqual()` to `@rjsf/utils.deepEquals` at precompiledValidator. + # 5.23.2 ## @rjsf/core diff --git a/packages/validator-ajv8/src/precompiledValidator.ts b/packages/validator-ajv8/src/precompiledValidator.ts index 1ec6bff8af..a79c079dcd 100644 --- a/packages/validator-ajv8/src/precompiledValidator.ts +++ b/packages/validator-ajv8/src/precompiledValidator.ts @@ -1,8 +1,9 @@ import { ErrorObject } from 'ajv'; import get from 'lodash/get'; -import { deepEqual } from 'fast-equals'; + import { CustomValidator, + deepEquals, ErrorSchema, ErrorTransformer, FormContextType, @@ -92,10 +93,10 @@ export default class AJV8PrecompiledValidator< * @param [formData] - The form data to validate if any */ ensureSameRootSchema(schema: S, formData?: T) { - if (!deepEqual(schema, this.rootSchema)) { + if (!deepEquals(schema, this.rootSchema)) { // Resolve the root schema with the passed in form data since that may affect the resolution const resolvedRootSchema = retrieveSchema(this, this.rootSchema, this.rootSchema, formData); - if (!deepEqual(schema, resolvedRootSchema)) { + if (!deepEquals(schema, resolvedRootSchema)) { throw new Error( 'The schema associated with the precompiled validator differs from the rootSchema provided for validation' );