github hey-api/openapi-ts @hey-api/openapi-ts@0.76.0

latest releases: @hey-api/openapi-ts@0.82.4, @hey-api/nuxt@0.2.1, @hey-api/openapi-ts@0.82.1...
2 months ago

Minor Changes

  • #2226 1c66d88 Thanks @mrlubos! - feat(valibot): generate a single schema for requests

    Single Valibot schema per request

    Previously, we generated a separate schema for each endpoint parameter and request body. In v0.76.0, a single request schema is generated for the whole endpoint. It may contain a request body, parameters, and headers.

    const vData = v.object({
      body: v.optional(
        v.object({
          foo: v.optional(v.string()),
          bar: v.optional(v.union([v.number(), v.null()])),
        }),
      ),
      headers: v.optional(v.never()),
      path: v.object({
        baz: v.string(),
      }),
      query: v.optional(v.never()),
    });

    If you need to access individual fields, you can do so using the .entries API. For example, we can get the request body schema with vData.entries.body.

Patch Changes

  • #2221 e335e1e Thanks @mrlubos! - fix(parser): prefer JSON media type

  • #2226 1c66d88 Thanks @mrlubos! - fix(valibot): add metadata option to generate additional metadata for documentation, code generation, AI structured outputs, form validation, and other purposes

Don't miss a new openapi-ts release

NewReleases is sending notifications on new releases.