From c494cd211e468447886a0fc7e785db6ce0532b75 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Wed, 31 Jul 2024 10:45:46 -0400 Subject: [PATCH] Allow INT/FLOAT represent list of numbers (#274) --- src/types/apiTypes.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/types/apiTypes.ts b/src/types/apiTypes.ts index bcb0a0073..58a6bf242 100644 --- a/src/types/apiTypes.ts +++ b/src/types/apiTypes.ts @@ -188,7 +188,9 @@ const zIntInputSpec = inputSpec([ min: z.number().optional(), max: z.number().optional(), step: z.number().optional(), - default: z.number().optional() + // Note: Many node authors are using INT to pass list of INT. + // TODO: Add list of ints type. + default: z.union([z.number(), z.array(z.number())]).optional() }) ]) @@ -199,7 +201,9 @@ const zFloatInputSpec = inputSpec([ max: z.number().optional(), step: z.number().optional(), round: z.union([z.number(), z.literal(false)]).optional(), - default: z.number().optional() + // Note: Many node authors are using FLOAT to pass list of FLOAT. + // TODO: Add list of floats type. + default: z.union([z.number(), z.array(z.number())]).optional() }) ])