Releases: hey-api/openapi-ts
@hey-api/openapi-ts@0.76.0
Minor Changes
-
#2226
1c66d88Thanks @mrlubos! - feat(valibot): generate a single schema for requestsSingle 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
.entriesAPI. For example, we can get the request body schema withvData.entries.body.
Patch Changes
@hey-api/openapi-ts@0.75.0
Minor Changes
-
#2215
82e56e9Thanks @mrlubos! - feat(parser): replaceplugin.subscribe()withplugin.forEach()Added
plugin.forEach()methodThis method replaces the
.subscribe()method. Additionally,.forEach()is executed immediately, which means we don't need thebeforeandafterevents – simply move your code before and after the.forEach()block.plugin.forEach('operation', 'schema', (event) => { // do something with event });
-
#2218
e5ff024Thanks @mrlubos! - feat(tanstack-query): add name and case optionsUpdated 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.
queryOptionsNameBuilderrenamed toqueryOptionsinfiniteQueryOptionsNameBuilderrenamed toinfiniteQueryOptionsmutationOptionsNameBuilderrenamed tomutationOptionsqueryKeyNameBuilderrenamed toqueryKeysinfiniteQueryKeyNameBuilderrenamed toinfiniteQueryKeys
Patch Changes
-
#2219
4df6fa0Thanks @mrlubos! - fix: make output pass stricter tsconfig configurations" -
#2213
2ffb612Thanks @mrlubos! - fix(validators): handle additional properties object when no other properties are defined -
#2216
1456f87Thanks @mrlubos! - fix(parser): addmetaandversionoptions to input.patch -
#2210
5b1362aThanks @mrlubos! - fix(cli): correctly detect watch mode
@hey-api/openapi-ts@0.74.0
Minor Changes
-
#2201
ab8cedeThanks @mrlubos! - feat(zod): generate a single schema for requestsSingle 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
.shapeAPI. For example, we can get the request body schema withzData.shape.body.
Patch Changes
@hey-api/openapi-ts@0.73.0
Minor Changes
-
#2172
29605a0Thanks @mrlubos! - feat: bundle@hey-api/client-*pluginsBundle
@hey-api/client-*pluginsIn 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
@hey-api/openapi-ts@0.72.2
Patch Changes
-
#2163
9769998Thanks @mrlubos! - fix(zod): addmetadataoption to generate additional metadata for documentation, code generation, AI structured outputs, form validation, and other purposes -
#2167
a46259eThanks @mrlubos! - fix(tanstack-query): add name builder options for all generated artifacts -
#2166
594f3a6Thanks @mrlubos! - fix(parser): filter orphans only when there are some operations -
#2166
594f3a6Thanks @mrlubos! - fix(zod): support tuple types -
#2167
a46259eThanks @mrlubos! - fix(parser): set correct subscription context for plugins
@hey-api/client-next@0.5.1
@hey-api/client-fetch@0.13.1
@hey-api/client-axios@0.9.1
@hey-api/openapi-ts@0.72.1
Patch Changes
- #2159
87b2d6cThanks @Joshua-hypt! - fix(zod): handle array union types