npm @orpc/openapi 0.23.0
v0.23.0

latest releases: 0.0.0-next.cc1a1aa, 1.13.0, 0.0.0-next.f01f7b1...
11 months ago

🚀 New Feature: Input/Output Structure 🎉

Simplify or customize how your API handles data with Input/Output Structure!

🌟 Highlights

  • inputStructure:

    • compact: Merges params + query/body.
    • detailed: Keeps params, query, headers, and body separate.
  • outputStructure:

    • compact: Returns only the body.
    • detailed: Separates headers and body.

Example

os.route({
  inputStructure: 'detailed',
  outputStructure: 'detailed',
})
  .input(z.object({
    params: z.object({ id: z.string() }),
    query: z.object({ search: z.string() }),
    body: z.object({ name: z.string() }).optional(),
  }))
  .handler((input) => ({
    body: { message: 'Hello' },
    headers: { 'x-header': 'value' },
  }));

   🚀 Features

   🐞 Bug Fixes

  • zod: Zod to json schema not covert zod description  -  by @unnoq (1cee9)
    View changes on GitHub

Don't miss a new openapi release

NewReleases is sending notifications on new releases.