Skip to content

v0.23.0

Compare
Choose a tag to compare
@github-actions github-actions released this 01 Jan 14:41
· 655 commits to main since this release

πŸš€ 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