@hey-api/openapi-ts
0.99.0 · 22 Jun 2026MIT8.3M / weekRepositoryHomepagenpmAtom feed
271 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 0.64.x
0.64.3
10 Feb 2025Correctly type default value for Nuxt client
0.64.2
10 Feb 2025Add exportFromIndex option to all plugins
Allow passing arbitrary values to SDK functions via
metafieldSanitize "+" in uri to avoid plus in function name
0.64.1
3 Feb 2025Watch mode handles servers not exposing HEAD method for spec
Add watch.timeout option
0.64.0
2 Feb 2025Added
client.baseUrloptionMake createConfig, CreateClientConfig, and Config accept ClientOptions generic
- 0.63.x
0.63.2
30 Jan 2025Lower Node version requirements
0.63.1
30 Jan 2025Update keywords in package.json
Add Next.js client
Support required client in SDK using sdk.client = false
Patch Changes
Update keywords in package.json
Add Next.js client
Support required client in SDK using sdk.client = false
Add support for openIdConnect auth flow
0.63.0
27 Jan 2025Move clients to plugins
Move sdk.throwOnError option to client.throwOnError
Sdks import client from client.gen.ts instead of defining it inside the file
Minor Changes
Move clients to plugins
Client plugins
Clients are now plugins generating their own `client.gen.ts` file. There's no migration needed if you're using CLI. If you're using the configuration file, move `client` options to `plugins`. ```js export default { client: '@hey-api/client-fetch', // [!code --] input: 'path/to/openapi.json', output: 'src/client', plugins: ['@hey-api/client-fetch'], // [!code ++] }; ```Patch Changes
Move sdk.throwOnError option to client.throwOnError
Moved
sdk.throwOnErroroptionThis SDK configuration option has been moved to the client plugins where applicable. Not every client can be configured to throw on error, so it didn't make sense to expose the option when it didn't have any effect. ```js export default { input: 'path/to/openapi.json', output: 'src/client', plugins: [ { name: '@hey-api/client-fetch', throwOnError: true, // [!code ++] }, { name: '@hey-api/sdk', throwOnError: true, // [!code --] }, ], }; ```Sdks import client from client.gen.ts instead of defining it inside the file
Added
client.gen.tsfileThe internal `client` instance previously located in `sdk.gen.ts` is now defined in `client.gen.ts`. If you're importing it in your code, update the import module. ```js import { client } from 'client/sdk.gen'; // [!code --] import { client } from 'client/client.gen'; // [!code ++] ```Throw if inferred plugin not found
- 0.62.x
0.62.3
21 Jan 2025Bundle clients from compiled index file
Generate correct response for text/plain content type
Do not use a body serializer on text/plain sdks
Patch Changes
Bundle clients from compiled index file
Generate correct response for text/plain content type
Do not use a body serializer on text/plain sdks
Support all oauth2 flows in sdk auth
Add null to valid bodySerializer types
0.62.2
20 Jan 2025Add support for Nuxt client
0.62.1
15 Jan 2025Generate bigint type instead of BigInt
Add ability to skip generating index file with output.indexFile
0.62.0
14 Jan 2025Change the default parser
Spread sdk options at the end to allow overriding generated values
- 0.61.x
0.61.3
13 Jan 2025Use z.coerce before calling z.bigint
0.61.2
9 Jan 2025Send GET request only on first spec fetch
0.61.1
8 Jan 2025Detect pagination in composite schemas with null type
Handle primitive constants in Zod and types
0.61.0
6 Jan 2025- Breaking
Please update
@hey-api/client-*packages to the latest versionfeat: add support for basic http auth
Add support for HTTP Bearer Authentication Scheme
Add OpenAPI 2.0 support to experimental parser
Minor Changes
Add support for HTTP Bearer Authentication Scheme
Add OpenAPI 2.0 support to experimental parser
Add watch mode
Watch Mode
::: warning Watch mode currently supports only remote files via URL. ::: If your schema changes frequently, you may want to automatically regenerate the output during development. To watch your input file for changes, enable `watch` mode in your configuration or pass the `--watch` flag to the CLI.
Config
```js export default { client: '@hey-api/client-fetch', input: 'path/to/openapi.json', output: 'src/client', watch: true, }; ```CLI
```sh npx @hey-api/openapi-ts \ -c @hey-api/client-fetch \ -i path/to/openapi.json \ -o src/client \ -w ```
- Breaking
Please update
@hey-api/client-*packages to the latest versionfeat: add support for basic http auth
Patch Changes
Add support for long integers
Add
sdk.throwOnErroroptionPreserve leading separators in enum keys
- 0.60.x
0.60.1
19 Dec 2024Handle indexed access checks
zod: generate patterns and improve plain schemas
Add links to the experimental parser callouts
Patch Changes
Handle indexed access checks
zod: generate patterns and improve plain schemas
Add links to the experimental parser callouts
Update types for custom plugins so defineConfig does not throw
Export IR types
Export utils
Allow plugins to explicitly declare whether they should be re-exported from the index file
0.60.0
17 Dec 2024Require sdk.transformer to use generated transformers
Revert license to MIT
Zod plugin generates response schemas
- 0.59.x
0.59.2
12 Dec 2024Generate querySerializer options for Axios client
Infer responseType in SDKs for axios client
Support oauth2 and apiKey security schemes
Patch Changes
Generate querySerializer options for Axios client
Infer responseType in SDKs for axios client
Support oauth2 and apiKey security schemes
Zod plugin handles recursive schemas
0.59.1
6 Dec 2024Prefix restricted identifier names with underscore
Disallow additional query parameters in experimental parser output
0.59.0
5 Dec 2024- Removed
Remove
@hey-api/schemasfrom default plugins Add
logs.leveloptionCorrectly resolve required properties in nested allOf composition
Minor Changes
Add
logs.leveloption
Added
logs.leveloptionYou can now configure different log levels. As part of this feature, we had to introduce a breaking change by moving the `debug` option to `logs.level`. This will affect you if you're calling `@hey-api/openapi-ts` from Node.js (not CLI) or using the configuration file. ```js export default { client: '@hey-api/client-fetch', debug: true, // [!code --] input: 'path/to/openapi.json', logs: { level: 'debug', // [!code ++] }, output: 'src/client', }; ```- Removed
Remove
@hey-api/schemasfrom default plugins
Updated default
plugins`@hey-api/schemas` has been removed from the default plugins. To continue using it, add it to your plugins array. ```js import { defaultPlugins } from '@hey-api/openapi-ts'; export default { client: '@hey-api/client-fetch', experimentalParser: true, input: 'path/to/openapi.json', output: 'src/client', plugins: [ ...defaultPlugins, '@hey-api/schemas', // [!code ++] ], }; ```Patch Changes
Correctly resolve required properties in nested allOf composition
Add
--silentor-sCLI option for silent log levelTransformers handle allOf composition in experimental parser
Add
logsconfiguration option to customize log directoryAllow arbitrary object properties when additionalProperties is undefined
Support
DEBUGenvironment variable
- 0.58.x
0.58.0
2 Dec 2024- Removed
Remove schemas and transformers re-exports from index.ts
- Removed
Add output.clean option
Add typescript.identifierCase option
Minor Changes
Add typescript.identifierCase option
Added
typescript.identifierCaseoption**This change affects only the experimental parser.** By default, the generated TypeScript interfaces will follow the PascalCase naming convention. In the previous versions, we tried to preserve the original name as much as possible. To keep the previous behavior, set `typescript.identifierCase` to `preserve`. ```js export default { client: '@hey-api/client-fetch', experimentalParser: true, input: 'path/to/openapi.json', output: 'src/client', plugins: [ // ...other plugins { identifierCase: 'preserve', // [!code ++] name: '@hey-api/typescript', }, ], }; ```- Removed
Remove schemas and transformers re-exports from index.ts
Removed
schemas.gen.tsre-export`index.ts` will no longer re-export `schemas.gen.ts` to reduce the chance of producing broken output. Please update your code to import from `schemas.gen.ts` directly. ```js import { mySchema } from 'client'; // [!code --] import { mySchema } from 'client/schemas.gen'; // [!code ++] ```Removed
transformers.gen.tsre-export`index.ts` will no longer re-export `transformers.gen.ts` to reduce the chance of producing broken output. Please update your code to import from `transformers.gen.ts` directly. ```js import { myTransformer } from 'client'; // [!code --] import { myTransformer } from 'client/transformers.gen'; // [!code ++] ```- Removed
Add output.clean option
Added
output.cleanoptionBy default, the `output.path` folder will be emptied on every run. To preserve the previous behavior, set `output.clean` to `false`. ```js export default { client: '@hey-api/client-fetch', input: 'path/to/openapi.json', output: { clean: false, // [!code ++] path: 'src/client', }, }; ```Add typescript.enumsCase option
Patch Changes
Add before and after to pagination keywords
Export Plugin API namespace
TanStack Query plugin handles conflict with internal function name in experimental parser
- 0.57.x
0.57.1
25 Nov 2024Transformers correctly handle an array
Improve camelcase with abbreviated plurals
Experimental parser generates url inside data types
Patch Changes
Transformers correctly handle an array
Improve camelcase with abbreviated plurals
Experimental parser generates url inside data types
Experimental parser transforms anyOf date and null
Experimental parser handles empty string and null enum values in JavaScript mode
Experimental parser exports reusable request bodies
0.57.0
22 Nov 2024Rename Hey API plugins
Add typescript.exportInlineEnums option
Improve generated enum keys in experimental parser
- 0.56.x
0.56.3
21 Nov 2024Zod plugin handles value constraints and defaults
0.56.2
20 Nov 2024Add input.exclude option
Make Zod plugin available in plugins options
0.56.1
18 Nov 2024Gracefully handle invalid schema type in experimental parser
0.56.0
18 Nov 2024- Deprecated
Deprecate types.tree option
Add
fastifypluginExport a map of error and response types by status code
Minor Changes
Add
fastifyplugin
Patch Changes
Export a map of error and response types by status code
- Deprecated
Deprecate types.tree option
Handle file-like content media type without explicit schema
- 0.55.x
0.55.3
13 Nov 2024Add support for oxlint as linter
0.55.2
10 Nov 2024Update sponsorship links
Correctly generate array when items are a oneOf array with length 1
Handle non-exploded array query parameters
Patch Changes
Update sponsorship links
Correctly generate array when items are a oneOf array with length 1
Handle non-exploded array query parameters
Handle discriminators in experimental parser
0.55.1
8 Nov 2024Handle nullable enums in experimental parser
Add support for custom plugins
Render void for empty response status codes in experimental parser
0.55.0
7 Nov 2024Add input.include option
Handle pagination with basic refs
- 0.54.x
0.54.4
6 Nov 2024Forbid any body, path, or query parameters if not defined in spec
Handle additionalProperties: boolean in experimental parser
Update schemas plugin to handle experimental 3.0.x parser
This release adds an experimental parser for OpenAPI versions 3.0.x. In the future, this will become the default parser. If you're using OpenAPI 3.0 or newer, we encourage you to try it out today.
You can enable the experimental parser by setting the
experimentalParserboolean flag totruein your configuration file or CLI.export default { client: '@hey-api/client-fetch', input: 'path/to/openapi.json', output: 'src/client', experimentalParser: true, };npx @hey-api/openapi-ts -i path/to/openapi.json -o src/client -c @hey-api/client-fetch -e
The generated output should not structurally change, despite few things being generated in a different order. In fact, the output should be cleaner! That's the immediate side effect you should notice. If that's not true, please leave feedback in GitHub issues.
Hey API parser marks an important milestone towards v1 of
@hey-api/openapi-ts. More features will be added to the parser in the future and the original parser fromopenapi-typescript-codegenwill be deprecated and used only for generating legacy clients.If you'd like to work with the parser more closely (e.g. to generate code not natively supported by this package), feel free to reach out with any feedback or suggestions. Happy parsing! 🎉
0.54.3
5 Nov 2024Add OpenAPI 3.0.x experimental parser
This release adds an experimental parser for OpenAPI versions 3.0.x. In the future, this will become the default parser. If you're using OpenAPI 3.0 or newer, we encourage you to try it out today.
You can enable the experimental parser by setting the
experimentalParserboolean flag totruein your configuration file or CLI.export default { client: '@hey-api/client-fetch', input: 'path/to/openapi.json', output: 'src/client', experimentalParser: true, };npx @hey-api/openapi-ts -i path/to/openapi.json -o src/client -c @hey-api/client-fetch -e
The generated output should not structurally change, despite few things being generated in a different order. In fact, the output should be cleaner! That's the immediate side effect you should notice. If that's not true, please leave feedback in GitHub issues.
Hey API parser marks an important milestone towards v1 of
@hey-api/openapi-ts. More features will be added to the parser in the future and the original parser fromopenapi-typescript-codegenwill be deprecated and used only for generating legacy clients.If you'd like to work with the parser more closely (e.g. to generate code not natively supported by this package), feel free to reach out with any feedback or suggestions. Happy parsing! 🎉
0.54.2
1 Nov 2024Add support for @tanstack/angular-query-experimental package
0.54.1
29 Oct 2024Ignore name option when not used with legacy clients to avoid producing broken output
Add support for OpenAPI 3.1.1 to experimental parser
0.54.0
28 Oct 2024Make plugins first-class citizens
This release makes plugins first-class citizens. In order to achieve that, the following breaking changes were introduced.
- 0.53.x
0.53.12
25 Oct 2024TanStack Query plugin using missing import for infinite query
Pass TanStack query signal to client call
0.53.11
13 Oct 2024Update website domain, add license documentation
0.53.10
11 Oct 2024Update license field in package.json to match the license, revert client packages license to MIT
0.53.9
10 Oct 2024Add support for passing mutation specific options to
<operation_id>Mutation(options)
0.53.8
6 Oct 2024Use correct relative path to bundled client when imported from nested module
0.53.7
3 Oct 2024Skip nested properties in oneOf and anyOf compositions
Abstract page params logic in TanStack Query plugin
0.53.6
30 Sep 2024Export spec-compliant OpenAPI 3.1 interface
Handle multiple form-data parameters in Swagger 2.0
0.53.5
26 Sep 2024Make TanStack Query plugin work with class-based services
Avoid printing duplicate null nodes
Attach TanStack Query infinite page params only if they exist
0.53.4
25 Sep 2024Import handlebars instead of runtime
Support dynamic require in child_process
0.53.3
22 Sep 2024Properly handle dual publishing and type generation
0.53.2
19 Sep 2024Handle colon in operation path
Allow overriding generated headers from options
Export Operation interface
Patch Changes
Handle colon in operation path
Allow overriding generated headers from options
Export Operation interface
Handle named object property with no nested properties
Transform any-of nullable dates
0.53.1
17 Sep 2024Throw error on invalid client value
0.53.0
4 Sep 2024Rename legacy clients with 'legacy/' prefix
Change schemas name pattern, add schemas.name option
Make UserConfig interface instead of type
Minor Changes
Rename legacy clients with 'legacy/' prefix
Change schemas name pattern, add schemas.name option
Patch Changes
Make UserConfig interface instead of type
Set query key base url from supplied client if provided
- 0.52.x
0.52.11
27 Aug 2024Export query key functions from TanStack Query plugin
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.