Releases: hey-api/openapi-ts
@hey-api/[email protected]
@hey-api/[email protected]
@hey-api/[email protected]
Minor Changes
-
#1387
7c4335d
Thanks @mrlubos! - feat: addlogs.level
optionAdded
logs.level
optionYou can now configure different log levels. As part of this feature, we had to introduce a breaking change by moving the
debug
option tologs.level
. This will affect you if you're calling@hey-api/openapi-ts
from Node.js (not CLI) or using the configuration file.export default { client: '@hey-api/client-fetch', debug: true, // [!code --] input: 'path/to/openapi.json', logs: { level: 'debug', // [!code ++] }, output: 'src/client', };
-
#1389
f4c98ec
Thanks @mrlubos! - feat: remove@hey-api/schemas
from default pluginsUpdated default
plugins
@hey-api/schemas
has been removed from the default plugins. To continue using it, add it to your plugins array.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
-
#1382
3580c1e
Thanks @mrlubos! - fix: correctly resolve required properties in nested allOf composition -
#1387
7c4335d
Thanks @mrlubos! - fix: add--silent
or-s
CLI option for silent log level -
#1382
3580c1e
Thanks @mrlubos! - fix: transformers handle allOf composition in experimental parser -
#1387
0def82c
Thanks @mrlubos! - feat: addlogs
configuration option to customize log directory -
#1390
8388c47
Thanks @mrlubos! - fix: allow arbitrary object properties when additionalProperties is undefined -
#1387
7c4335d
Thanks @mrlubos! - fix: supportDEBUG
environment variable
@hey-api/[email protected]
@hey-api/[email protected]
Minor Changes
-
#1353
efd3e54
Thanks @mrlubos! - feat: add typescript.identifierCase optionAdded
typescript.identifierCase
optionThis 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
topreserve
.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', }, ], };
-
#1360
5f6ddd7
Thanks @mrlubos! - fix: remove schemas and transformers re-exports from index.tsRemoved
schemas.gen.ts
re-exportindex.ts
will no longer re-exportschemas.gen.ts
to reduce the chance of producing broken output. Please update your code to import fromschemas.gen.ts
directly.import { mySchema } from 'client'; // [!code --] import { mySchema } from 'client/schemas.gen'; // [!code ++]
Removed
transformers.gen.ts
re-exportindex.ts
will no longer re-exporttransformers.gen.ts
to reduce the chance of producing broken output. Please update your code to import fromtransformers.gen.ts
directly.import { myTransformer } from 'client'; // [!code --] import { myTransformer } from 'client/transformers.gen'; // [!code ++]
-
#1360
5f6ddd7
Thanks @mrlubos! - feat: add output.clean optionAdded
output.clean
optionBy default, the
output.path
folder will be emptied on every run. To preserve the previous behavior, setoutput.clean
tofalse
.export default { client: '@hey-api/client-fetch', input: 'path/to/openapi.json', output: { clean: false, // [!code ++] path: 'src/client', }, };
-
#1362
3bf7169
Thanks @mrlubos! - feat: add typescript.enumsCase option
Patch Changes
@hey-api/[email protected]
Patch Changes
-
#1335
bb9a848
Thanks @mrlubos! - fix: transformers correctly handle an array -
#1332
25b598b
Thanks @mrlubos! - fix: improve camelcase with abbreviated plurals -
#1333
734a62d
Thanks @mrlubos! - fix: experimental parser generates url inside data types -
#1336
6857da8
Thanks @mrlubos! - fix: experimental parser transforms anyOf date and null -
#1330
3d68587
Thanks @mrlubos! - fix: experimental parser handles empty string and null enum values in JavaScript mode -
#1340
c8511e0
Thanks @mrlubos! - fix: experimental parser exports reusable request bodies
@hey-api/[email protected]
Minor Changes
-
#1333
734a62d
Thanks @mrlubos! - feat: add buildUrl() methodBuild URL
::: warning
To use this feature, you must opt in to the experimental parser.
:::If you need to access the compiled URL, you can use the
buildUrl()
method. It's loosely typed by default to accept almost any value; in practice, you will want to pass a type hint.type FooData = { path: { fooId: number; }; query?: { bar?: string; }; url: '/foo/{fooId}'; }; const url = client.buildUrl<FooData>({ path: { fooId: 1, }, query: { bar: 'baz', }, url: '/foo/{fooId}', }); console.log(url); // prints '/foo/1?bar=baz'
Patch Changes
@hey-api/[email protected]
@hey-api/[email protected]
Minor Changes
-
#1324
4e62378
Thanks @mrlubos! - feat: rename Hey API pluginsRenamed
@hey-api/services
pluginThis plugin has been renamed to
@hey-api/sdk
.Changed
sdk.output
valueTo align with the updated name, the
@hey-api/sdk
plugin will generate ansdk.gen.ts
file. This will result in a breaking change if you're importing fromservices.gen.ts
. Please update your imports to reflect this change.import { client } from 'client/services.gen'; // [!code --] import { client } from 'client/sdk.gen'; // [!code ++]
Renamed
@hey-api/types
pluginThis plugin has been renamed to
@hey-api/typescript
. -
#1327
62e37d5
Thanks @mrlubos! - feat: add typescript.exportInlineEnums optionAdded
typescript.exportInlineEnums
optionBy default, inline enums (enums not defined as reusable components in the input file) will be generated only as inlined union types. You can set
exportInlineEnums
totrue
to treat inline enums as reusable components. Whentrue
, the exported enums will follow the style defined inenums
.This is a breaking change since in the previous versions, inline enums were always treated as reusable components. To preserve your current output, set
exportInlineEnums
totrue
. This feature works only with the experimental parser.export default { client: '@hey-api/client-fetch', experimentalParser: true, input: 'path/to/openapi.json', output: 'src/client', plugins: [ // ...other plugins { exportInlineEnums: true, // [!code ++] name: '@hey-api/typescript', }, ], };