Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(frontend): use custom rjsf validator for anyOf fields (#13420)

seer-by-sentry[bot]7613033ec1e9
diff --git a/autogpt_platform/frontend/src/components/renderers/InputRenderer/base/anyof/useAnyOfField.ts b/autogpt_platform/frontend/src/components/renderers/InputRenderer/base/anyof/useAnyOfField.ts
index 0c20cecd10..9535567945 100644
--- a/autogpt_platform/frontend/src/components/renderers/InputRenderer/base/anyof/useAnyOfField.ts
+++ b/autogpt_platform/frontend/src/components/renderers/InputRenderer/base/anyof/useAnyOfField.ts
@@ -1,6 +1,6 @@
import { FieldProps, getFirstMatchingOption, mergeSchemas } from "@rjsf/utils";
import { useRef, useState } from "react";
-import validator from "@rjsf/validator-ajv8";
+import { customValidator } from "../../utils/custom-validator";
import { getDefaultTypeIndex } from "./helpers";
import { cleanUpHandleId } from "../../helpers";
import { useEdgeStore } from "@/app/(platform)/build/stores/edgeStore";
@@ -12,7 +12,7 @@ export const useAnyOfField = (props: FieldProps) => {
const getInitialOption = () => {
if (formData !== undefined && formData !== null) {
const option = getFirstMatchingOption(
- validator,
+ customValidator,
formData,
options,
schema,