openapi-zod-client
openapi-zod-client copied to clipboard
fix arrays of union types
fixes #287
the following object
const openApiDoc: OpenAPIObject = {
openapi: "3.0.0",
info: {
version: "1.0.0",
title: "Union array",
},
paths: {},
components: {
schemas: {
Foo: {
type: "object",
properties: {
foo: { type: "integer", enum: [1, 2] },
},
},
Bar: {
type: "object",
properties: {
bar: { type: "string", enum: ["a", "b"] },
},
},
Union: {
type: "object",
properties: {
unionArray: {
items: {
anyOf: [{ $ref: "#/components/schemas/Foo" }, { $ref: "#/components/schemas/Bar" }],
},
type: "array",
},
},
},
},
},
};
expected:
unionArray: Array<Foo | Bar>;
received
unionArray: Array<(Foo | Bar) | Array<Foo | Bar>>;
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| openapi-zod-client-rim4 | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 21, 2024 6:40pm |