Open nikhilro opened 1 year ago
Running into Schemas with 'type: array', require a sibling 'items: ' field error when validating the OpenAPI schema that's generated by the plugin.
Schemas with 'type: array', require a sibling 'items: ' field
// this is my endpoint .get("/", ({ store: { db }, orgId }) => getCustomers(db(), orgId), { response: t.Array(Customer), }) // this is the type import { BaseDbModel } from "./baseTypes"; import { Static } from "@sinclair/typebox"; import { t } from "elysia"; export const CustomerParams = t.Object({ number: t.Optional(t.Union([t.String(), t.Null()])), }); export type CustomerParams = Static<typeof CustomerParams>; export const Customer = t.Intersect([ BaseDbModel, CustomerParams, t.Object({ orgId: t.String() }), ]); export type Customer = Static<typeof Customer>;
Would appreciate any ideas!
Running into
Schemas with 'type: array', require a sibling 'items: ' field
error when validating the OpenAPI schema that's generated by the plugin.Would appreciate any ideas!