You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Expose the internal ajv variable in the validator implementation classes (rjsf-team#3991)
* Fix: Expose the internal `ajv` variable in the validator implementation classes
Fixes: rjsf-team#3972 indirectly by exposing the `ajv` variable for use in the issue
- In `@rjsf/ajv6`, updated `AJV6Validator` to make the `ajv` variable public and changed the return of the `customizeValidator()` function to remove the interface return
- In `@rjsf/ajv8`, updated `AJV8Validator` to make the `ajv` variable public and changed the return of the `customizeValidator()` function to remove the interface return
- Also removed some `@ts-expect-error` tags that are no longer needed due to the exposed variable
- Updated the `CHANGELOG.md` accordingly
* - Responded to reviewer feedback
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,18 @@ should change the heading of the (upcoming) version to include a major version b
21
21
22
22
- fix `getFieldNames`. Now correctly defines an array of primitives.
23
23
24
+
## @rjsf/validator-ajv6
25
+
26
+
- Updated the `AJV6Validator` class to expose the internal `ajv` object, allowing access to support a fix related to [#3972](https://github.com/rjsf-team/react-jsonschema-form/issues/3972)
27
+
28
+
## @rjsf/validator-ajv8
29
+
30
+
- Updated the `AJV8Validator` class to expose the internal `ajv` object, allowing access to support a fix related to [#3972](https://github.com/rjsf-team/react-jsonschema-form/issues/3972)
31
+
32
+
## Dev / docs / playground
33
+
34
+
- Updated the documentation to describe how to use the newly exposed `ajv` variable
The `customizeValidator()` function returns the `AJV8Validator` (or `AJV6Validator` depending on the library you use) implementation class, which has an internal raw `ajv` instance within it.
591
+
If you need to do some deep customization of the instance using any of the `ajv` libraries (like `ajv-keywords`), you can do so using this raw instance as follows:
0 commit comments