github middleapi/orpc v1.5.1

latest releases: v1.14.0, v1.13.14, v1.13.13...
10 months ago

Common Schemas docs

Define reusable schema components that can be referenced across your OpenAPI specification (Only support zod 3 and 4 for now):

const UserSchema = z.object({
  id: z.string(),
  name: z.string(),
  email: z.string().email(),
})

const PetSchema = z.object({
  id: z.string().transform(id => Number(id)).pipe(z.number()),
})

const spec = await generator.generate(router, {
  commonSchemas: {
    User: {
      schema: UserSchema,
    },
    InputPet: {
      strategy: 'input',
      schema: PetSchema,
    },
    OutputPet: {
      strategy: 'output',
      schema: PetSchema,
    },
  },
})

   🚀 Features

   🐞 Bug Fixes

  • openapi: OpenAPIGenerator make response headers optional when headers object is optional  -  by @dinwwwh in #642 (5b223)
    View changes on GitHub

Don't miss a new orpc release

NewReleases is sending notifications on new releases.