From 3bdc16ac5fe2d8f2492735468da722d8705c9c78 Mon Sep 17 00:00:00 2001 From: zhsama Date: Fri, 30 Jan 2026 23:30:51 +0800 Subject: [PATCH] refactor: make validateJSONSchema type-safe Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-Claude) Co-authored-by: Sisyphus --- web/app/components/workflow/variable-inspect/utils.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/variable-inspect/utils.tsx b/web/app/components/workflow/variable-inspect/utils.tsx index a5e44e2767..c08c35eaae 100644 --- a/web/app/components/workflow/variable-inspect/utils.tsx +++ b/web/app/components/workflow/variable-inspect/utils.tsx @@ -42,7 +42,7 @@ export const toEnvVarInInspect = (envVar: EnvironmentVariable): VarInInspect => } } -export const validateJSONSchema = (schema: any, type: string) => { +export const validateJSONSchema = (schema: unknown, type: string): z.SafeParseReturnType => { if (type === 'array[string]') { const result = arrayStringSchemaParttern.safeParse(schema) return result @@ -60,7 +60,7 @@ export const validateJSONSchema = (schema: any, type: string) => { return result } else { - return { success: true } as any + return z.unknown().safeParse(schema) } }