We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c70d5ab commit 381e423Copy full SHA for 381e423
apps/playground-web/src/app/insight/[blueprint_slug]/blueprint-playground.client.tsx
@@ -815,9 +815,13 @@ function openAPIV3ParamToZodFormSchema(
815
}
816
817
if (itemSchema) {
818
- return isRequired
+ const arraySchema = isRequired
819
? z.array(itemSchema).min(1, { message: "Required" })
820
- : z.array(itemSchema).optional();
+ : z.array(itemSchema);
821
+ const arrayOrSingleItemSchema = z.union([arraySchema, itemSchema]);
822
+ return isRequired
823
+ ? arrayOrSingleItemSchema
824
+ : arrayOrSingleItemSchema.optional();
825
826
827
break;
0 commit comments