diff --git a/apps/playground-web/src/app/insight/[blueprint_slug]/blueprint-playground.client.tsx b/apps/playground-web/src/app/insight/[blueprint_slug]/blueprint-playground.client.tsx index 67b82a353e4..7555eec0980 100644 --- a/apps/playground-web/src/app/insight/[blueprint_slug]/blueprint-playground.client.tsx +++ b/apps/playground-web/src/app/insight/[blueprint_slug]/blueprint-playground.client.tsx @@ -815,9 +815,13 @@ function openAPIV3ParamToZodFormSchema( } if (itemSchema) { - return isRequired + const arraySchema = isRequired ? z.array(itemSchema).min(1, { message: "Required" }) - : z.array(itemSchema).optional(); + : z.array(itemSchema); + const arrayOrSingleItemSchema = z.union([arraySchema, itemSchema]); + return isRequired + ? arrayOrSingleItemSchema + : arrayOrSingleItemSchema.optional(); } } break;