From 1e18c828d9ca17138b4d49948cac3aaf0371a3fe Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 28 Jul 2025 14:09:34 +0800 Subject: [PATCH] chore: remove transform boolean to string in editor --- .../components/json-schema-config-modal/json-schema-config.tsx | 3 --- web/app/components/workflow/nodes/llm/utils.ts | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx index fecd1093d9..b87dc6e245 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx @@ -11,7 +11,6 @@ import VisualEditor from './visual-editor' import SchemaEditor from './schema-editor' import { checkJsonSchemaDepth, - convertBooleanToString, getValidationErrorMessage, jsonToSchema, preValidateSchema, @@ -87,7 +86,6 @@ const JsonSchemaConfig: FC = ({ setValidationError(`Schema exceeds maximum depth of ${JSON_SCHEMA_MAX_DEPTH}.`) return } - convertBooleanToString(schema) const validationErrors = validateSchemaAgainstDraft7(schema) if (validationErrors.length > 0) { setValidationError(getValidationErrorMessage(validationErrors)) @@ -168,7 +166,6 @@ const JsonSchemaConfig: FC = ({ setValidationError(`Schema exceeds maximum depth of ${JSON_SCHEMA_MAX_DEPTH}.`) return } - convertBooleanToString(schema) const validationErrors = validateSchemaAgainstDraft7(schema) if (validationErrors.length > 0) { setValidationError(getValidationErrorMessage(validationErrors)) diff --git a/web/app/components/workflow/nodes/llm/utils.ts b/web/app/components/workflow/nodes/llm/utils.ts index b29646de66..e6736169a5 100644 --- a/web/app/components/workflow/nodes/llm/utils.ts +++ b/web/app/components/workflow/nodes/llm/utils.ts @@ -303,6 +303,7 @@ export const getValidationErrorMessage = (errors: ValidationError[]) => { return message } +// Previous Not support boolean type, so transform boolean to string when paste it into schema editor export const convertBooleanToString = (schema: any) => { if (schema.type === Type.boolean) schema.type = Type.string