这是indexloc提供的服务,不要输入任何密码
Skip to content

Releases: hey-api/openapi-ts

@hey-api/openapi-ts@0.76.0

22 Jun 21:02
acac297
Compare
Choose a tag to compare

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

@hey-api/openapi-ts@0.75.0

21 Jun 19:35
5d85d29
Compare
Choose a tag to compare

Minor Changes

  • #2215 82e56e9 Thanks @mrlubos! - feat(parser): replace plugin.subscribe() with plugin.forEach()

    Added plugin.forEach() method

    This method replaces the .subscribe() method. Additionally, .forEach() is executed immediately, which means we don't need the before and after events – simply move your code before and after the .forEach() block.

    plugin.forEach('operation', 'schema', (event) => {
      // do something with event
    });
  • #2218 e5ff024 Thanks @mrlubos! - feat(tanstack-query): add name and case options

    Updated TanStack Query options

    The TanStack Query plugin options have been expanded to support more naming and casing patterns. As a result, the following options have been renamed.

    • queryOptionsNameBuilder renamed to queryOptions
    • infiniteQueryOptionsNameBuilder renamed to infiniteQueryOptions
    • mutationOptionsNameBuilder renamed to mutationOptions
    • queryKeyNameBuilder renamed to queryKeys
    • infiniteQueryKeyNameBuilder renamed to infiniteQueryKeys

Patch Changes

@hey-api/openapi-ts@0.74.0

19 Jun 16:00
c778f69
Compare
Choose a tag to compare

Minor Changes

  • #2201 ab8cede Thanks @mrlubos! - feat(zod): generate a single schema for requests

    Single Zod schema per request

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

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

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

Patch Changes

  • #2192 7a740ed Thanks @Daschi1! - fix(valibot): use isoTimestamp instead of isoDateTime for date-time format

  • #2201 a889c3c Thanks @mrlubos! - fix(parser): do not mark schemas as duplicate if they have different format

@hey-api/openapi-ts@0.73.0

14 Jun 08:44
ba29123
Compare
Choose a tag to compare

Minor Changes

  • #2172 29605a0 Thanks @mrlubos! - feat: bundle @hey-api/client-* plugins

    Bundle @hey-api/client-* plugins

    In previous releases, you had to install a separate client package to generate a fully working output, e.g. npm install @hey-api/client-fetch. This created a few challenges: getting started was slower, upgrading was sometimes painful, and bundling too. Beginning with v0.73.0, all Hey API clients are bundled by default and don't require installing any additional dependencies. You can remove any installed client packages and re-run @hey-api/openapi-ts.

    npm uninstall @hey-api/client-fetch

Patch Changes

@hey-api/nuxt@0.2.0

14 Jun 09:17
95f1ae7
Compare
Choose a tag to compare

Minor Changes

@hey-api/openapi-ts@0.72.2

12 Jun 12:15
7365e4a
Compare
Choose a tag to compare

Patch Changes

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

  • #2167 a46259e Thanks @mrlubos! - fix(tanstack-query): add name builder options for all generated artifacts

  • #2166 594f3a6 Thanks @mrlubos! - fix(parser): filter orphans only when there are some operations

  • #2166 594f3a6 Thanks @mrlubos! - fix(zod): support tuple types

  • #2167 a46259e Thanks @mrlubos! - fix(parser): set correct subscription context for plugins

@hey-api/client-next@0.5.1

12 Jun 12:15
7365e4a
Compare
Choose a tag to compare

Patch Changes

@hey-api/client-fetch@0.13.1

12 Jun 12:15
7365e4a
Compare
Choose a tag to compare

Patch Changes

@hey-api/client-axios@0.9.1

12 Jun 12:15
7365e4a
Compare
Choose a tag to compare

Patch Changes

@hey-api/openapi-ts@0.72.1

11 Jun 14:01
c9f3245
Compare
Choose a tag to compare

Patch Changes