---
title: "Migrating"
description: "Migrating to @hey-api/openapi-ts."
url: "https://heyapi.dev/docs/openapi/typescript/migrating"
---

While we try to avoid breaking changes, sometimes it’s unavoidable in order to offer you the latest features. This page lists changes that require updates to your code. If you run into a problem with migration, please [open an issue](https://github.com/hey-api/openapi-ts/issues).

## v0.97.0

[Section titled “v0.97.0”](#v0970)

### Changed `runtimeConfigPath` behavior

[Section titled “Changed runtimeConfigPath behavior”](#changed-runtimeconfigpath-behavior)

This was a known, long-standing issue confusing first-time users. Before, defining client `runtimeConfigPath` value would paste it verbatim to the generated output. This release changes the behavior to resolve relative to the output folder.

### Changed Ky client behavior

[Section titled “Changed Ky client behavior”](#changed-ky-client-behavior)

The Ky client was updated to be more intuitive. Some Ky options now need to be passed via the `kyOptions` field and you need to pass `undefined` to unset an option.

### Changed error interceptors behavior

[Section titled “Changed error interceptors behavior”](#changed-error-interceptors-behavior)

Error interceptors now receive the result of the previous error interceptor. This aligns their behavior with request and response interceptors. This change only affects you if you use multiple interceptors.

### Optional client request and response

[Section titled “Optional client request and response”](#optional-client-request-and-response)

The returned request and response objects are now typed as optional. This aligns the types with the actual runtime behavior, which remains unchanged.

### Respect `throwOnError` option

[Section titled “Respect throwOnError option”](#respect-throwonerror-option)

Previously, there were instances where setting `throwOnError` to `false` would still throw an error. This most commonly happened when request validation failed. With this change, `throwOnError` is now truly respected.

## v0.96.0

[Section titled “v0.96.0”](#v0960)

### Removed Node 20 support

[Section titled “Removed Node 20 support”](#removed-node-20-support)

This release bumps the minimum required Node version to 22.13.

## v0.95.0

[Section titled “v0.95.0”](#v0950)

### Validator request schemas

[Section titled “Validator request schemas”](#validator-request-schemas)

Valibot and Zod plugins no longer export composite request `Data` schemas. Instead, each layer is exported as a separate schema. If you’re using validators with SDKs, you can preserve the composite schema with `shouldExtract`:

* Zod

  openapi-ts.config.ts

  ```js
  export default {
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
    plugins: [
      // ...other plugins
      {
        name: 'sdk',
        validator: 'zod',
      },
      {
        name: 'zod',
        requests: {
          shouldExtract: true,
        },
      },
    ],
  };
  ```

* Valibot

  openapi-ts.config.ts

  ```js
  export default {
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
    plugins: [
      // ...other plugins
      {
        name: 'sdk',
        validator: 'valibot',
      },
      {
        name: 'valibot',
        requests: {
          shouldExtract: true,
        },
      },
    ],
  };
  ```

### Removed `plugin.getSymbol()` function

[Section titled “Removed plugin.getSymbol() function”](#removed-plugingetsymbol-function)

This function has been removed. You can use `plugin.querySymbol()` instead. It accepts the same arguments and returns the same result.

## v0.93.0

[Section titled “v0.93.0”](#v0930)

### Removed resolver node

[Section titled “Removed resolver node”](#removed-resolver-node)

Valibot and Zod plugins no longer expose the `enum.nodes.nullable` node. Both plugins were refactored so that nullable values are handled outside of resolvers.

## v0.92.0

[Section titled “v0.92.0”](#v0920)

### Updated Symbol interface

[Section titled “Updated Symbol interface”](#updated-symbol-interface)

The `exportFrom` property has been replaced with the `getExportFromFilePath()` function. This allows you to dynamically determine export paths based on symbol properties. This is a low-level feature, so you’re most likely unaffected.

## v0.91.0

[Section titled “v0.91.0”](#v0910)

### Removed CommonJS (CJS) support

[Section titled “Removed CommonJS (CJS) support”](#removed-commonjs-cjs-support)

`@hey-api/openapi-ts` is now ESM-only. This change simplifies the codebase, improves tree-shaking, and enables better integration with modern bundlers and TypeScript tooling.

CommonJS entry points (`require()`, `module.exports`) are no longer supported. If you are in a CJS environment, you can still load the package dynamically using `import()` like:

```js
const { defineConfig } = await import('@hey-api/openapi-ts');
```

If you have previously written:

```js
const { defineConfig } = require('@hey-api/openapi-ts');
```

Migrate by updating your static imports:

```js
import { defineConfig } from '@hey-api/openapi-ts';
```

If your environment cannot use ESM, pin to a previous version.

## v0.90.0

[Section titled “v0.90.0”](#v0900)

### Resolvers API

[Section titled “Resolvers API”](#resolvers-api)

The [Resolvers API](https://heyapi.dev/openapi-ts/plugins/concepts/resolvers) has been simplified and expanded to provide a more consistent behavior across plugins. You can view a few common examples on the [Resolvers](https://heyapi.dev/openapi-ts/plugins/concepts/resolvers) page.

### Structure API

[Section titled “Structure API”](#structure-api)

The [SDK plugin](https://heyapi.dev/openapi-ts/plugins/sdk) and [Angular plugin](https://heyapi.dev/openapi-ts/plugins/angular) now implement the Structure API, enabling more complex structures and fixing several known issues.

Some Structure APIs are incompatible with the previous configuration, most notably the `methodNameBuilder` function, which accepted the operation object as an argument. You can read the [SDK Output](https://heyapi.dev/openapi-ts/plugins/sdk#output) section to familiarize yourself with the Structure API.

Please [open an issue](https://github.com/hey-api/openapi-ts/issues) if you’re unable to migrate your configuration to the new syntax.

## v0.89.0

[Section titled “v0.89.0”](#v0890)

### Prefer named exports

[Section titled “Prefer named exports”](#prefer-named-exports)

This release changes the default for `index.ts` to prefer named exports. Named exports may lead to better IDE and bundler performance compared to asterisk (`*`) as your tooling doesn’t have to inspect the underlying module to discover exports.

While this change is merely cosmetic, you can set `output.preferExportAll` to `true` if you prefer to use the asterisk.

openapi-ts.config.ts

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: {
    path: 'src/client',
    preferExportAll: true,
  },
};
```

### Removed `symbol:setValue:*` events

[Section titled “Removed symbol:setValue:\* events”](#removed-symbolsetvalue-events)

These events have been removed in favor of `node:set:*` events.

## v0.88.0

[Section titled “v0.88.0”](#v0880)

### Removed `compiler` and `tsc` exports

[Section titled “Removed compiler and tsc exports”](#removed-compiler-and-tsc-exports)

This release removes the `compiler` utility functions. Instead, it introduces a new TypeScript DSL exposed under the `$` symbol. All plugins now use this interface, so you may notice slight changes in the generated output.

## v0.87.0

[Section titled “v0.87.0”](#v0870)

### Removed legacy clients

[Section titled “Removed legacy clients”](#removed-legacy-clients)

This release removes support for legacy clients and plugins. Please migrate to the new clients if you haven’t done so yet. If you’re unable to do so due to a missing feature, let us know on [GitHub](https://github.com/hey-api/openapi-ts/issues).

## v0.86.0

[Section titled “v0.86.0”](#v0860)

### Removed Node 18 support

[Section titled “Removed Node 18 support”](#removed-node-18-support)

This release bumps the minimum required Node version to 20.19.

## v0.85.0

[Section titled “v0.85.0”](#v0850)

### Updated `output` options

[Section titled “Updated output options”](#updated-output-options)

We made the `output` configuration more consistent by using `null` to represent disabled options. This change does not affect boolean options.

openapi-ts.config.ts

```diff
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: {
    -format: false,
    +format: null,
    -lint: false,
    +lint: null,
    path: 'src/client',
    -tsConfigPath: 'off',
    +tsConfigPath: null,
  },
};
```

### Updated Pinia Colada query options

[Section titled “Updated Pinia Colada query options”](#updated-pinia-colada-query-options)

Pinia Colada query options now use `defineQueryOptions` to improve reactivity support. Instead of calling the query options function, you can use one of the following approaches.

* no params

  colada.gen.ts

  ```ts
  useQuery(getPetsQuery);
  ```

* constant

  colada.gen.ts

  ```ts
  useQuery(getPetByIdQuery, () => ({
    path: {
      petId: 1,
    },
  }));
  ```

* reactive

  colada.gen.ts

  ```ts
  const petId = ref<number | null>(1);


  useQuery(getPetByIdQuery, () => ({
    path: {
      petId: petId.value,
    },
  }));
  ```

* properties

  colada.gen.ts

  ```ts
  const petId = ref<number | null>(1);


  useQuery(() => ({
    ...getPetByIdQuery({
      path: { petId: petId.value as number },
    }),
    enabled: () => petId.value !== null,
  }));
  ```

## v0.84.0

[Section titled “v0.84.0”](#v0840)

### Symbol API

[Section titled “Symbol API”](#symbol-api)

This release improves the Symbol API, which adds the capability to place symbols in arbitrary files. We preserved the previous output structure for all plugins except Angular.

You can preserve the previous Angular output by writing your own [placement function](https://heyapi.dev/openapi-ts/configuration/parser#hooks-symbols).

### TypeScript renderer

[Section titled “TypeScript renderer”](#typescript-renderer)

We ship a dedicated TypeScript renderer for `.ts` files. This release improves the renderer’s ability to group and sort imported modules, resulting in a more polished output.

### Removed `output` plugin option

[Section titled “Removed output plugin option”](#removed-output-plugin-option)

Due to the Symbol API release, this option has been removed from the Plugin API.

## v0.83.0

[Section titled “v0.83.0”](#v0830)

### Symbol API

[Section titled “Symbol API”](#symbol-api-1)

This release adds the Symbol API, which significantly reduces the risk of naming collisions. While the generated output should only include formatting changes, this feature introduces breaking changes to the Plugin API that affect custom plugins.

We will update the [custom plugin guide](https://heyapi.dev/openapi-ts/plugins/custom) once the Plugin API becomes more stable.

### Removed `groupByTag` Pinia Colada option

[Section titled “Removed groupByTag Pinia Colada option”](#removed-groupbytag-pinia-colada-option)

This option has been removed to provide a more consistent API across plugins. We plan to bring it back in a future release.

## v0.82.0

[Section titled “v0.82.0”](#v0820)

### Hooks API

[Section titled “Hooks API”](#hooks-api)

This release adds the [Hooks API](https://heyapi.dev/openapi-ts/configuration/parser#hooks), giving you granular control over which operations generate queries and mutations. As a result, we tightened the previous behavior and POST operations no longer generate queries by default. To preserve the old behavior, add a custom matcher.

openapi-ts.config.ts

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  parser: {
    hooks: {
      operations: {
        isQuery: (op) => (op.method === 'post' ? true : undefined),
      },
    },
  },
};
```

## v0.81.0

[Section titled “v0.81.0”](#v0810)

### Server-Sent Events (SSE)

[Section titled “Server-Sent Events (SSE)”](#server-sent-events-sse)

This release adds support for server-sent events (SSE). Instead of treating `text/event-stream` content types as regular HTTP methods, we now generate SSE streams. In practice, you will want to update your affected endpoints to process streamed events.

* before

  client.gen.ts

  ```js
  const { data } = await foo();
  console.log(data.type);
  ```

* after

  client.gen.ts

  ```js
  const { stream } = await foo();
  for await (const event of stream) {
    console.log(event.type);
  }
  ```

## v0.80.0

[Section titled “v0.80.0”](#v0800)

### Added Zod 4 and Zod Mini

[Section titled “Added Zod 4 and Zod Mini”](#added-zod-4-and-zod-mini)

This release adds support for Zod 4 and Zod Mini. By default, the `zod` plugin will generate output for Zod 4. If you want to preserve the previous output for Zod 3 or use Zod Mini, set `compatibilityVersion` to `3` or `mini`.

* Zod 3

  openapi-ts.config.ts

  ```js
  export default {
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
    plugins: [
      // ...other plugins
      {
        name: 'zod',
        compatibilityVersion: 3,
      },
    ],
  };
  ```

* Zod Mini

  openapi-ts.config.ts

  ```js
  export default {
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
    plugins: [
      // ...other plugins
      {
        name: 'zod',
        compatibilityVersion: 'mini',
      },
    ],
  };
  ```

## v0.79.0

[Section titled “v0.79.0”](#v0790)

### Removed `typescript+namespace` enums mode

[Section titled “Removed typescript+namespace enums mode”](#removed-typescriptnamespace-enums-mode)

Due to a simpler TypeScript plugin implementation, the `typescript+namespace` enums mode is no longer necessary. This mode was used in the past to group inline enums under the same namespace. With the latest changes, this behavior is no longer supported. You can either choose to ignore inline enums (default), or use the `enums` transform (added in v0.78.0) to convert them into reusable components which will get exported as usual.

## v0.78.0

[Section titled “v0.78.0”](#v0780)

### Added `parser` options

[Section titled “Added parser options”](#added-parser-options)

Previously, `@hey-api/typescript` would generate correct types, but the validator plugins would have to re-implement the same logic or generate schemas that didn’t match the generated types.

Since neither option was ideal, this release adds a dedicated place for `parser` options. Parser is responsible for preparing the input so plugins can generate more accurate output with less effort.

You can learn more about configuring parser on the [Parser](https://heyapi.dev/openapi-ts/configuration/parser) page.

### Moved `input` options

[Section titled “Moved input options”](#moved-input-options)

The following options were moved to the new `parser` group.

* `input.filters` moved to `parser.filters`
* `input.pagination` moved to `parser.pagination`
* `input.patch` moved to `parser.patch`
* `input.validate_EXPERIMENTAL` moved to `parser.validate_EXPERIMENTAL`

### Updated `typescript` options

[Section titled “Updated typescript options”](#updated-typescript-options)

The following options were renamed.

* `enumsCase` moved to `enums.case`
* `enumsConstantsIgnoreNull` moved to `enums.constantsIgnoreNull`

### Moved `typescript` options

[Section titled “Moved typescript options”](#moved-typescript-options)

The following options were moved to the new `parser` group.

* `exportInlineEnums` moved to `parser.transforms.enums`
* `readOnlyWriteOnlyBehavior` moved to `parser.transforms.readWrite.enabled`
* `readableNameBuilder` moved to `parser.transforms.readWrite.responses.name`
* `writableNameBuilder` moved to `parser.transforms.readWrite.requests.name`

### Updated `readWrite.responses` name

[Section titled “Updated readWrite.responses name”](#updated-readwriteresponses-name)

Additionally, the naming pattern for response schemas has changed from `{name}Readable` to `{name}`. This is to prevent your code from breaking by default when using a schema that gets updated with a write-only field.

## v0.77.0

[Section titled “v0.77.0”](#v0770)

### Updated `sdk.validator` option

[Section titled “Updated sdk.validator option”](#updated-sdkvalidator-option)

Clients can now validate both request and response data. As a result, passing a boolean or string to `validator` will control both of these options. To preserve the previous behavior, set `validator.request` to `false` and `validator.response` to your previous configuration.

openapi-ts.config.ts

```diff
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  plugins: [
    // ...other plugins
    {
      name: '@hey-api/sdk',
      -validator: true,
      +validator: {
        +request: false,
        +response: true,
      +},
    },
  ],
};
```

### Updated Plugin API

[Section titled “Updated Plugin API”](#updated-plugin-api)

Please refer to the [custom plugin](https://heyapi.dev/openapi-ts/plugins/custom) tutorial for the latest guide.

## v0.76.0

[Section titled “v0.76.0”](#v0760)

### Single Valibot schema per request

[Section titled “Single Valibot schema per request”](#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.

```ts
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`](https://valibot.dev/api/object/) API. For example, we can get the request body schema with `vData.entries.body`.

## v0.75.0

[Section titled “v0.75.0”](#v0750)

### Updated TanStack Query options

[Section titled “Updated TanStack Query 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`

### Added `plugin.forEach()` method

[Section titled “Added plugin.forEach() method”](#added-pluginforeach-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.

```diff
-plugin.subscribe('operation', (event) => {
  // do something with event
-});
-plugin.subscribe('schema', (event) => {
+plugin.forEach('operation', 'schema', (event) => {
  // do something with event
});
```

## v0.74.0

[Section titled “v0.74.0”](#v0740)

### Single Zod schema per request

[Section titled “Single Zod schema per request”](#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.

```ts
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`](https://zod.dev/api?id=shape) API. For example, we can get the request body schema with `zData.shape.body`.

## v0.73.0

[Section titled “v0.73.0”](#v0730)

### Bundle `@hey-api/client-*` plugins

[Section titled “Bundle @hey-api/client-\* plugins”](#bundle-hey-apiclient--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`.

```sh
npm uninstall @hey-api/client-fetch
```

## v0.72.0

[Section titled “v0.72.0”](#v0720)

### Added `sdk.classStructure` option

[Section titled “Added sdk.classStructure option”](#added-sdkclassstructure-option)

When generating class-based SDKs, we now try to infer the ideal structure using `operationId` keywords. If you’d like to preserve the previous behavior, set `classStructure` to `off`.

openapi-ts.config.ts

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  plugins: [
    // ...other plugins
    {
      classStructure: 'off',
      name: '@hey-api/sdk',
    },
  ],
};
```

## v0.71.0

[Section titled “v0.71.0”](#v0710)

### Renamed `sdk.serviceNameBuilder` option

[Section titled “Renamed sdk.serviceNameBuilder option”](#renamed-sdkservicenamebuilder-option)

This option has been renamed to `sdk.classNameBuilder` to better represent its functionality. Additionally, it’s no longer set by default. To preserve the previous behavior, update your configuration.

openapi-ts.config.ts

```diff
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  plugins: [
    // ...other plugins
    {
      +classNameBuilder: '{{name}}Service',
      name: '@hey-api/sdk',
      -serviceNameBuilder: '{{name}}Service',
    },
  ],
};
```

## v0.68.0

[Section titled “v0.68.0”](#v0680)

### Upgraded input filters

[Section titled “Upgraded input filters”](#upgraded-input-filters)

Input filters now avoid generating invalid output without requiring you to specify every missing schema as in the previous releases. As part of this release, we changed the way filters are configured and removed the support for regular expressions. Let us know if regular expressions are still useful for you and want to bring them back!

* include

  openapi-ts.config.ts

  ```diff
  export default {
    input: {
      // match only the schema named `foo` and `GET` operation for the `/api/v1/foo` path
      filters: {
        operations: {
          include: ['GET /api/v1/foo'],
        },
        schemas: {
          include: ['foo'],
        },
      },
      -include: '^(#/components/schemas/foo|#/paths/api/v1/foo/get)$',
      path: 'hey-api/backend', // sign up at app.heyapi.dev
    },
    output: 'src/client',
    plugins: ['@hey-api/client-fetch'],
  };
  ```

* exclude

  openapi-ts.config.ts

  ```diff
  export default {
    input: {
      // match everything except for the schema named `foo` and `GET` operation for the `/api/v1/foo` path
      -exclude: '^(#/components/schemas/foo|#/paths/api/v1/foo/get)$',
      filters: {
        operations: {
          exclude: ['GET /api/v1/foo'],
        },
        schemas: {
          exclude: ['foo'],
        },
      },
      path: 'hey-api/backend', // sign up at app.heyapi.dev
    },
    output: 'src/client',
    plugins: ['@hey-api/client-fetch'],
  };
  ```

## v0.67.0

[Section titled “v0.67.0”](#v0670)

### Respecting `moduleResolution` value in `tsconfig.json`

[Section titled “Respecting moduleResolution value in tsconfig.json”](#respecting-moduleresolution-value-in-tsconfigjson)

This release introduces functionality related to your `tsconfig.json` file. The initial feature properly respects the value of your `moduleResolution` field. If you’re using `nodenext`, the relative module paths in your output will be appended with `.js`. To preserve the previous behavior where we never appended `.js` to relative module paths, set `output.tsConfigPath` to `off`.

openapi-ts.config.ts

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: {
    path: 'src/client',
    tsConfigPath: 'off',
  },
};
```

## v0.66.0

[Section titled “v0.66.0”](#v0660)

### Read-only and write-only fields

[Section titled “Read-only and write-only fields”](#read-only-and-write-only-fields)

Starting with v0.66.0, `@hey-api/typescript` will generate separate types for payloads and responses if it detects any read-only or write-only fields. To preserve the previous behavior and generate a single type regardless, set `readOnlyWriteOnlyBehavior` to `off`.

openapi-ts.config.ts

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  plugins: [
    // ...other plugins
    {
      name: '@hey-api/typescript',
      readOnlyWriteOnlyBehavior: 'off',
    },
  ],
};
```

## v0.64.0

[Section titled “v0.64.0”](#v0640)

### Added `ClientOptions` interface

[Section titled “Added ClientOptions interface”](#added-clientoptions-interface)

The `Config` interface now accepts an optional generic extending `ClientOptions` instead of `boolean` type `ThrowOnError`.

```diff
-type Foo = Config<false>;
+type Foo = Config<{ throwOnError: false }>;
```

### Added `client.baseUrl` option

[Section titled “Added client.baseUrl option”](#added-clientbaseurl-option)

You can use this option to configure the default base URL for the generated client. By default, we will attempt to resolve the first defined server or infer the base URL from the input path. If you’d like to preserve the previous behavior, set `baseUrl` to `false`.

openapi-ts.config.ts

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  plugins: [
    {
      baseUrl: false,
      name: '@hey-api/client-fetch',
    },
  ],
};
```

## v0.63.0

[Section titled “v0.63.0”](#v0630)

### Client plugins

[Section titled “Client 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`.

openapi-ts.config.ts

```diff
export default {
  -client: '@hey-api/client-fetch',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  +plugins: ['@hey-api/client-fetch'],
};
```

### Added `client.gen.ts` file

[Section titled “Added client.gen.ts file”](#added-clientgents-file)

Related to above, the 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.

```diff
-import { client } from 'client/sdk.gen';
+import { client } from 'client/client.gen';
```

### Moved `sdk.throwOnError` option

[Section titled “Moved sdk.throwOnError option”](#moved-sdkthrowonerror-option)

This 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.

openapi-ts.config.ts

```diff
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  plugins: [
    {
      name: '@hey-api/client-fetch',
      +throwOnError: true,
    },
    {
      name: '@hey-api/sdk',
      -throwOnError: true,
    },
  ],
};
```

## v0.62.0

[Section titled “v0.62.0”](#v0620)

### Changed parser

[Section titled “Changed parser”](#changed-parser)

Formerly known as the experimental parser, this is now the default parser. This change should not impact the generated output’s functionality. However, there might be cases where this results in breaking changes due to different handling of certain scenarios. If you need to revert to the legacy parser, set the `experimentalParser` flag to `false`.

openapi-ts.config.ts

```js
export default {
  client: '@hey-api/client-fetch',
  experimentalParser: false,
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
};
```

Note that the legacy parser is no longer supported and will be removed in the v1 release.

## v0.61.0

[Section titled “v0.61.0”](#v0610)

### Added `auth` option

[Section titled “Added auth option”](#added-auth-option)

Client package functions `accessToken` and `apiKey` were replaced with a single `auth` function for fetching auth tokens. If your API supports multiple auth mechanisms, you can use the `auth` argument to return the appropriate token.

```diff
import { client } from 'client/sdk.gen';


client.setConfig({
  -accessToken: () => '<my_token>',
  -apiKey: () => '<my_token>',
  +auth: (auth) => '<my_token>',
});
```

Due to conflict with the Axios native `auth` option, we removed support for configuring Axios auth. Please let us know if you require this feature added back.

### Added `watch` option

[Section titled “Added watch option”](#added-watch-option)

While this is a new feature, supporting it involved replacing the `@apidevtools/json-schema-ref-parser` dependency with our own implementation. Since this was a big change, we’re applying caution and marking this as a breaking change.

### Changed `parseAs: 'auto'` behavior

[Section titled “Changed parseAs: 'auto' behavior”](#changed-parseas-auto-behavior)

The Fetch API client will return raw response body as `ReadableStream` when `Content-Type` response header is undefined and `parseAs` is `auto`.

## v0.60.0

[Section titled “v0.60.0”](#v0600)

### Added `sdk.transformer` option

[Section titled “Added sdk.transformer option”](#added-sdktransformer-option)

When generating SDKs, you now have to specify `transformer` in order to modify response data. By default, adding `@hey-api/transformers` to your plugins will only produce additional output. To preserve the previous functionality, set `sdk.transformer` to `true`.

openapi-ts.config.ts

```js
export default {
  client: '@hey-api/client-fetch',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  plugins: [
    // ...other plugins
    {
      dates: true,
      name: '@hey-api/transformers',
    },
    {
      name: '@hey-api/sdk',
      transformer: true,
    },
  ],
};
```

## v0.59.0

[Section titled “v0.59.0”](#v0590)

### Added `logs.level` option

[Section titled “Added logs.level option”](#added-logslevel-option)

You 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.

openapi-ts.config.ts

```diff
export default {
  client: '@hey-api/client-fetch',
  -debug: true,
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  logs: {
    +level: 'debug',
  },
  output: 'src/client',
};
```

### Updated default `plugins`

[Section titled “Updated 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.

openapi-ts.config.ts

```js
export default {
  client: '@hey-api/client-fetch',
  experimentalParser: true,
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  plugins: [
    // ...other plugins
    '@hey-api/schemas',
  ],
};
```

## v0.58.0

[Section titled “v0.58.0”](#v0580)

### Removed `schemas.gen.ts` re-export

[Section titled “Removed schemas.gen.ts re-export”](#removed-schemasgents-re-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.

```diff
-import { mySchema } from 'client';
+import { mySchema } from 'client/schemas.gen';
```

### Removed `transformers.gen.ts` re-export

[Section titled “Removed transformers.gen.ts re-export”](#removed-transformersgents-re-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.

```diff
-import { myTransformer } from 'client';
+import { myTransformer } from 'client/transformers.gen';
```

### Added `output.clean` option

[Section titled “Added output.clean option”](#added-outputclean-option)

By default, the `output.path` folder will be emptied on every run. To preserve the previous behavior, set `output.clean` to `false`.

openapi-ts.config.ts

```js
export default {
  client: '@hey-api/client-fetch',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: {
    clean: false,
    path: 'src/client',
  },
};
```

### Added `typescript.identifierCase` option

[Section titled “Added typescript.identifierCase option”](#added-typescriptidentifiercase-option)

**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`.

openapi-ts.config.ts

```js
export default {
  client: '@hey-api/client-fetch',
  experimentalParser: true,
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  plugins: [
    // ...other plugins
    {
      identifierCase: 'preserve',
      name: '@hey-api/typescript',
    },
  ],
};
```

## v0.57.0

[Section titled “v0.57.0”](#v0570)

### Renamed `@hey-api/services` plugin

[Section titled “Renamed @hey-api/services plugin”](#renamed-hey-apiservices-plugin)

This plugin has been renamed to `@hey-api/sdk`.

### Changed `sdk.output` value

[Section titled “Changed sdk.output value”](#changed-sdkoutput-value)

To align with the updated name, the `@hey-api/sdk` plugin will generate an `sdk.gen.ts` file. This will result in a breaking change if you’re importing from `services.gen.ts`. Please update your imports to reflect this change.

```diff
-import { client } from 'client/services.gen';
+import { client } from 'client/sdk.gen';
```

### Renamed `@hey-api/types` plugin

[Section titled “Renamed @hey-api/types plugin”](#renamed-hey-apitypes-plugin)

This plugin has been renamed to `@hey-api/typescript`.

### Added `typescript.exportInlineEnums` option

[Section titled “Added typescript.exportInlineEnums option”](#added-typescriptexportinlineenums-option)

By 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` to `true` to treat inline enums as reusable components. When `true`, the exported enums will follow the style defined in `enums`.

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` to `true`. This feature works only with the experimental parser.

openapi-ts.config.ts

```js
export default {
  client: '@hey-api/client-fetch',
  experimentalParser: true,
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  plugins: [
    // ...other plugins
    {
      exportInlineEnums: true,
      name: '@hey-api/typescript',
    },
  ],
};
```

## v0.56.0

[Section titled “v0.56.0”](#v0560)

### Deprecated `tree` in `@hey-api/types`

[Section titled “Deprecated tree in @hey-api/types”](#deprecated-tree-in-hey-apitypes)

This config option is deprecated and will be removed when the experimental parser becomes the default.

## v0.55.0

[Section titled “v0.55.0”](#v0550)

This release adds the ability to filter your OpenAPI specification before it’s processed. This feature will be useful if you are working with a large specification and are interested in generating output only from a small subset.

This feature is available only in the experimental parser. In the future, this will become the default parser. To opt-in to the experimental parser, set the `experimentalParser` flag in your configuration to `true`.

### Deprecated `include` in `@hey-api/types`

[Section titled “Deprecated include in @hey-api/types”](#deprecated-include-in-hey-apitypes)

This config option is deprecated and will be removed when the experimental parser becomes the default.

### Deprecated `filter` in `@hey-api/services`

[Section titled “Deprecated filter in @hey-api/services”](#deprecated-filter-in-hey-apiservices)

This config option is deprecated and will be removed when the experimental parser becomes the default.

### Added `input.include` option

[Section titled “Added input.include option”](#added-inputinclude-option)

This config option can be used to replace the deprecated options. It accepts a regular expression string matching against references within the bundled specification.

openapi-ts.config.ts

```js
export default {
  client: '@hey-api/client-fetch',
  experimentalParser: true,
  input: {
    include: '^(#/components/schemas/foo|#/paths/api/v1/foo/get)$',
    path: 'hey-api/backend', // sign up at app.heyapi.dev
  },
  output: 'src/client',
};
```

The configuration above will process only the schema named `foo` and `GET` operation for the `/api/v1/foo` path.

## v0.54.0

[Section titled “v0.54.0”](#v0540)

This release makes plugins first-class citizens. In order to achieve that, the following breaking changes were introduced.

### Removed CLI options

[Section titled “Removed CLI options”](#removed-cli-options)

The `--types`, `--schemas`, and `--services` CLI options have been removed. You can list which plugins you’d like to use explicitly by passing a list of plugins as `--plugins <plugin1> <plugin2>`

### Removed `*.export` option

[Section titled “Removed \*.export option”](#removed-export-option)

Previously, you could explicitly disable export of certain artifacts using the `*.export` option or its shorthand variant. These were both removed. You can now disable export of specific artifacts by manually defining an array of `plugins` and excluding the unwanted plugin.

* shorthand

  openapi-ts.config.ts

  ```diff
  export default {
    client: '@hey-api/client-fetch',
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
    -schemas: false,
    +plugins: ['@hey-api/types', '@hey-api/services'],
  };
  ```

* exclude

  \*.export

  ```diff
  export default {
    client: '@hey-api/client-fetch',
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
    schemas: {
      -export: false,
    },
    +plugins: ['@hey-api/types', '@hey-api/services'],
  };
  ```

### Renamed `schemas.name` option

[Section titled “Renamed schemas.name option”](#renamed-schemasname-option)

Each plugin definition contains a `name` field. This was conflicting with the `schemas.name` option. As a result, it has been renamed to `nameBuilder`.

openapi-ts.config.ts

```diff
export default {
  client: '@hey-api/client-fetch',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  schemas: {
    -name: (name) => `${name}Schema`,
  },
  plugins: [
    // ...other plugins
    {
      +nameBuilder: (name) => `${name}Schema`,
      name: '@hey-api/schemas',
    },
  ],
};
```

### Removed `services.include` shorthand option

[Section titled “Removed services.include shorthand option”](#removed-servicesinclude-shorthand-option)

Previously, you could use a string value as a shorthand for the `services.include` configuration option. You can now achieve the same result using the `include` option.

openapi-ts.config.ts

```diff
export default {
  client: '@hey-api/client-fetch',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  -services: '^MySchema',
  plugins: [
    // ...other plugins
    {
      +include: '^MySchema',
      name: '@hey-api/services',
    },
  ],
};
```

### Renamed `services.name` option

[Section titled “Renamed services.name option”](#renamed-servicesname-option)

Each plugin definition contains a `name` field. This was conflicting with the `services.name` option. As a result, it has been renamed to `serviceNameBuilder`.

openapi-ts.config.ts

```diff
export default {
  client: '@hey-api/client-fetch',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  services: {
    -name: '{{name}}Service',
  },
  plugins: [
    // ...other plugins
    {
      +serviceNameBuilder: '{{name}}Service',
      name: '@hey-api/services',
    },
  ],
};
```

### Renamed `types.dates` option

[Section titled “Renamed types.dates option”](#renamed-typesdates-option)

Previously, you could set `types.dates` to a boolean or a string value, depending on whether you wanted to transform only type strings into dates, or runtime code too. Many people found these options confusing, so they have been simplified to a boolean and extracted into a separate `@hey-api/transformers` plugin.

openapi-ts.config.ts

```diff
export default {
  client: '@hey-api/client-fetch',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  types: {
    -dates: 'types+transform',
  },
  plugins: [
    // ...other plugins
    {
      +dates: true,
      name: '@hey-api/transformers',
    },
  ],
};
```

### Removed `types.include` shorthand option

[Section titled “Removed types.include shorthand option”](#removed-typesinclude-shorthand-option)

Previously, you could use a string value as a shorthand for the `types.include` configuration option. You can now achieve the same result using the `include` option.

openapi-ts.config.ts

```diff
export default {
  client: '@hey-api/client-fetch',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  -types: '^MySchema',
  plugins: [
    // ...other plugins
    {
      +include: '^MySchema',
      name: '@hey-api/types',
    },
  ],
};
```

### Renamed `types.name` option

[Section titled “Renamed types.name option”](#renamed-typesname-option)

Each plugin definition contains a `name` field. This was conflicting with the `types.name` option. As a result, it has been renamed to `style`.

openapi-ts.config.ts

```diff
export default {
  client: '@hey-api/client-fetch',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  types: {
    -name: 'PascalCase',
  },
  plugins: [
    // ...other plugins
    {
      name: '@hey-api/types',
      +style: 'PascalCase',
    },
  ],
};
```

## v0.53.0

[Section titled “v0.53.0”](#v0530)

### Changed schemas name pattern

[Section titled “Changed schemas name pattern”](#changed-schemas-name-pattern)

Previously, generated schemas would have their definition names prefixed with `$`. This was problematic when using them with Svelte due to reserved keyword conflicts. The new naming pattern for schemas suffixes their definition names with `Schema`. You can continue using the previous pattern by setting the `schemas.name` configuration option.

openapi-ts.config.ts

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  schemas: {
    name: (name) => `$${name}`,
  },
};
```

### Renamed legacy clients

[Section titled “Renamed legacy clients”](#renamed-legacy-clients)

Legacy clients were renamed to signal they are deprecated more clearly. To continue using legacy clients, you will need to update your configuration and prefix them with `legacy/`.

* fetch

  openapi-ts.config.ts

  ```diff
  export default {
    -client: 'fetch',
    +client: 'legacy/fetch',
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
  };
  ```

* axios

  openapi-ts.config.ts

  ```diff
  export default {
    -client: 'axios',
    +client: 'legacy/axios',
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
  };
  ```

* angular

  openapi-ts.config.ts

  ```diff
  export default {
    -client: 'angular',
    +client: 'legacy/angular',
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
  };
  ```

* node

  openapi-ts.config.ts

  ```diff
  export default {
    -client: 'node',
    +client: 'legacy/node',
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
  };
  ```

* xhr

  openapi-ts.config.ts

  ```diff
  export default {
    -client: 'xhr',
    +client: 'legacy/xhr',
    input: 'hey-api/backend', // sign up at app.heyapi.dev
    output: 'src/client',
  };
  ```

## v0.52.0

[Section titled “v0.52.0”](#v0520)

### Removed internal `client` export

[Section titled “Removed internal client export”](#removed-internal-client-export)

Previously, client packages would create a default client which you’d then import and configure.

```js
import { client, createClient } from '@hey-api/client-fetch';


createClient({
  baseUrl: 'https://example.com',
});


console.log(client.getConfig().baseUrl); // <-- 'https://example.com'
```

This client instance was used internally by services unless overridden. Apart from running `createClient()` twice, people were confused about the meaning of `global` configuration option.

Starting with v0.52.0, client packages will not create a default client. Instead, services will define their own client. You can now achieve the same configuration by importing `client` from services and using the new `setConfig()` method.

```js
import { client } from 'client/services.gen';


client.setConfig({
  baseUrl: 'https://example.com',
});


console.log(client.getConfig().baseUrl); // <-- 'https://example.com'
```

## v0.51.0

[Section titled “v0.51.0”](#v0510)

### Required `client` option

[Section titled “Required client option”](#required-client-option)

Client now has to be explicitly specified and `@hey-api/openapi-ts` will no longer generate a legacy Fetch API client by default. To preserve the previous default behavior, set the `client` option to `fetch`.

openapi-ts.config.ts

```js
export default {
  client: 'fetch',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
};
```

## v0.48.0

[Section titled “v0.48.0”](#v0480)

### Changed `methodNameBuilder()` signature

[Section titled “Changed methodNameBuilder() signature”](#changed-methodnamebuilder-signature)

The `services.methodNameBuilder()` function now provides a single `operation` argument instead of multiple cherry-picked properties from it.

openapi-ts.config.ts

```diff
import { createClient } from '@hey-api/openapi-ts';


createClient({
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  services: {
    -methodNameBuilder: (service, name) => name,
    +methodNameBuilder: (operation) => operation.name,
  },
});
```

## v0.46.0

[Section titled “v0.46.0”](#v0460)

### Tree-shakeable services

[Section titled “Tree-shakeable services”](#tree-shakeable-services)

By default, your services will now support [tree-shaking](https://developer.mozilla.org/docs/Glossary/Tree_shaking). You can either use wildcard imports

```diff
-import { DefaultService } from 'client/services.gen';
+import * as DefaultService from 'client/services.gen';


DefaultService.foo(); // only import needs to be changed
```

or update all references to service classes

```diff
-import { DefaultService } from 'client/services.gen';
+import { foo } from 'client/services.gen';


foo(); // all references need to be changed
```

If you want to preserve the old behavior, you can set the newly exposed `services.asClass` option to `true.`

openapi-ts.config.ts

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  services: {
    asClass: true,
  },
};
```

## v0.45.0

[Section titled “v0.45.0”](#v0450)

### Removed `client` inference

[Section titled “Removed client inference”](#removed-client-inference)

`@hey-api/openapi-ts` will no longer infer which client you want to generate. By default, we will create a `fetch` client. If you want a different client, you can specify it using the `client` option.

openapi-ts.config.ts

```js
export default {
  client: 'axios',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
};
```

## v0.44.0

[Section titled “v0.44.0”](#v0440)

### Moved `format`

[Section titled “Moved format”](#moved-format)

This config option has been moved. You can now configure formatter using the `output.format` option.

openapi-ts.config.ts

```diff
export default {
  -format: 'prettier',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: {
    +format: 'prettier',
    path: 'src/client',
  },
};
```

### Moved `lint`

[Section titled “Moved lint”](#moved-lint)

This config option has been moved. You can now configure linter using the `output.lint` option.

openapi-ts.config.ts

```diff
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  -lint: 'eslint',
  output: {
    +lint: 'eslint',
    path: 'src/client',
  },
};
```

## v0.43.0

[Section titled “v0.43.0”](#v0430)

### Removed `enums.gen.ts`

[Section titled “Removed enums.gen.ts”](#removed-enumsgents)

This file has been removed. Instead, enums are exported from `types.gen.ts`. If you use imports from `enums.gen.ts`, you should be able to easily find and replace all instances.

```diff
-import { Foo } from 'client/enums.gen';
+import { Foo } from 'client/types.gen';
```

### Removed `Enum` postfix

[Section titled “Removed Enum postfix”](#removed-enum-postfix)

Generated enum names are no longer postfixed with `Enum`. You can either alias your imports

```diff
-import { FooEnum } from 'client/types.gen';
+import { Foo as FooEnum } from 'client/types.gen';


console.log(FooEnum.value); // only import needs to be changed
```

or update all references to enums

```diff
-import { FooEnum } from 'client/types.gen';
+import { Foo } from 'client/types.gen';


console.log(Foo.value); // all references need to be changed
```

### Moved `enums`

[Section titled “Moved enums”](#moved-enums)

This config option has been moved. You can now configure enums using the `types.enums` option.

openapi-ts.config.ts

```diff
export default {
  -enums: 'javascript',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  types: {
    +enums: 'javascript',
  },
};
```

## v0.42.0

[Section titled “v0.42.0”](#v0420)

### Changed `format`

[Section titled “Changed format”](#changed-format)

This config option has changed. You now need to specify a value (`biome` or `prettier`) to format the output (default: `false`).

```js
export default {
  format: 'prettier',
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
}
```

### Changed `lint`

[Section titled “Changed lint”](#changed-lint)

This config option has changed. You now need to specify a value (`biome` or `eslint`) to lint the output (default: `false`).

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  lint: 'eslint',
  output: 'src/client',
}
```

### Moved `operationId`

[Section titled “Moved operationId”](#moved-operationid)

This config option has been moved. You can now configure it using the `services.operationId` option.

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  services: {
    operationId: true,
  },
}
```

## v0.41.0

[Section titled “v0.41.0”](#v0410)

### Removed `postfixServices`

[Section titled “Removed postfixServices”](#removed-postfixservices)

This config option has been removed. You can now transform service names using the string pattern parameter.

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  services: {
    name: 'myAwesome{{name}}Api',
  },
}
```

### Removed `serviceResponse`

[Section titled “Removed serviceResponse”](#removed-serviceresponse)

This config option has been removed. You can now configure service responses using the `services.response` option.

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  services: {
    response: 'body',
  },
}
```

### Removed `useDateType`

[Section titled “Removed useDateType”](#removed-usedatetype)

This config option has been removed. You can now configure date type using the `types.dates` option.

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  type: {
    dates: true,
  },
}
```

## v0.40.0

[Section titled “v0.40.0”](#v0400)

### Renamed `models.gen.ts` file

[Section titled “Renamed models.gen.ts file”](#renamed-modelsgents-file)

`models.gen.ts` is now called `types.gen.ts`. If you use imports from `models.gen.ts`, you should be able to easily find and replace all instances.

```diff
-import type { Model } from 'client/models.gen';
+import type { Model } from 'client/types.gen';
```

### Renamed `exportModels`

[Section titled “Renamed exportModels”](#renamed-exportmodels)

This config option is now called `types`.

### PascalCase for types

[Section titled “PascalCase for types”](#pascalcase-for-types)

You can now choose to export types using the PascalCase naming convention.

```js
export default {
  input: 'hey-api/backend', // sign up at app.heyapi.dev
  output: 'src/client',
  types: {
    name: 'PascalCase',
  },
}
```

### Exported `enums.gen.ts` file

[Section titled “Exported enums.gen.ts file”](#exported-enumsgents-file)

Enums are now re-exported from the main `index.ts` file.

## v0.39.0

[Section titled “v0.39.0”](#v0390)

### Single `enums.gen.ts` file

[Section titled “Single enums.gen.ts file”](#single-enumsgents-file)

Enums are now exported from a separate file. If you use imports from `models.ts`, you can change them to `enums.gen.ts`.

```diff
-import { Enum } from 'client/models';
+import { Enum } from 'client/enums.gen';
```

### Renamed `models.ts` file

[Section titled “Renamed models.ts file”](#renamed-modelsts-file)

`models.ts` is now called `models.gen.ts`. If you use imports from `models.ts`, you should be able to easily find and replace all instances.

```diff
-import type { Model } from 'client/models';
+import type { Model } from 'client/models.gen';
```

### Renamed `schemas.ts` file

[Section titled “Renamed schemas.ts file”](#renamed-schemasts-file)

`schemas.ts` is now called `schemas.gen.ts`. If you use imports from `schemas.ts`, you should be able to easily find and replace all instances.

```diff
-import { $Schema } from 'client/schemas';
+import { $Schema } from 'client/schemas.gen';
```

### Renamed `services.ts` file

[Section titled “Renamed services.ts file”](#renamed-servicests-file)

`services.ts` is now called `services.gen.ts`. If you use imports from `services.ts`, you should be able to easily find and replace all instances.

```diff
-import { DefaultService } from 'client/services';
+import { DefaultService } from 'client/services.gen';
```

### Deprecated exports from `index.ts`

[Section titled “Deprecated exports from index.ts”](#deprecated-exports-from-indexts)

Until this release, `index.ts` file exported all generated artifacts. Starting from this release, enums are no longer exported from `index.ts`. Models, schemas, and services will continue to be exported from `index.ts` to avoid a huge migration lift, but we recommend migrating to import groups per artifact type.

```diff
-import { Enum, type Model, $Schema, DefaultService } from 'client';
+import { Enum } from 'client/enums.gen';
+import type { Model } from 'client/models.gen';
+import { $Schema } from 'client/schemas.gen';
+import { DefaultService } from 'client/services.gen';
```

### Prefer `unknown`

[Section titled “Prefer unknown”](#prefer-unknown)

Types that cannot be determined will now be generated as `unknown` instead of `any`. To dismiss any errors, you can cast your variables back to `any`, but we recommend updating your code to work with `unknown` types.

```js
const foo = bar as any
```

## v0.38.0

[Section titled “v0.38.0”](#v0380)

### Renamed `write`

[Section titled “Renamed write”](#renamed-write)

This config option is now called `dryRun` (file) or `--dry-run` (CLI). To restore existing functionality, invert the value, ie. `write: true` is `dryRun: false` and `write: false` is `dryRun: true`.

## v0.36.0

[Section titled “v0.36.0”](#v0360)

### JSON Schema 2020-12

[Section titled “JSON Schema 2020-12”](#json-schema-2020-12)

Schemas are exported directly from OpenAPI specification. This means your schemas might change depending on which OpenAPI version you’re using. If this release caused a field to be removed, consult the JSON Schema documentation on how to obtain the same value from JSON Schema (e.g., [required properties](https://json-schema.org/understanding-json-schema/reference/object#required)).

### Renamed `exportSchemas`

[Section titled “Renamed exportSchemas”](#renamed-exportschemas)

This config option is now called `schemas`.

## v0.35.0

[Section titled “v0.35.0”](#v0350)

### Removed `postfixModels`

[Section titled “Removed postfixModels”](#removed-postfixmodels)

This config option has been removed.

## v0.34.0

[Section titled “v0.34.0”](#v0340)

### Single `services.ts` file

[Section titled “Single services.ts file”](#single-servicests-file)

Services are now exported from a single file. If you used imports from individual service files, these will need to be updated to refer to the single `services.ts` file.

## v0.31.1

[Section titled “v0.31.1”](#v0311)

### Merged enums options

[Section titled “Merged enums options”](#merged-enums-options)

`useLegacyEnums` config option is now `enums: 'typescript'` and existing `enums: true` option is now `enums: 'javascript'`.

## v0.31.0

[Section titled “v0.31.0”](#v0310)

### Single `models.ts` file

[Section titled “Single models.ts file”](#single-modelsts-file)

TypeScript interfaces are now exported from a single file. If you used imports from individual model files, these will need to be updated to refer to the single `models.ts` file.

### Single `schemas.ts` file

[Section titled “Single schemas.ts file”](#single-schemasts-file)

Schemas are now exported from a single file. If you used imports from individual schema files, these will need to be updated to refer to the single `schemas.ts` file.

## v0.27.38

[Section titled “v0.27.38”](#v02738)

### `useOptions: true`

[Section titled “useOptions: true”](#useoptions-true)

By default, generated clients will use a single object argument to pass values to API calls. This is a significant change from the previous default of unspecified array of arguments. If migrating your application in one go isn’t feasible, we recommend deprecating your old client and generating a new client.

```ts
import { DefaultService } from 'client/services'; // <-- old client with array arguments


import { DefaultService } from 'client_v2/services'; // <-- new client with options argument
```

This way, you can gradually switch over to the new syntax as you update parts of your code. Once you’ve removed all instances of `client` imports, you can safely delete the old `client` folder and find and replace all `client_v2` calls to `client`.

## v0.27.36

[Section titled “v0.27.36”](#v02736)

### `exportSchemas: true`

[Section titled “exportSchemas: true”](#exportschemas-true)

By default, we will create schemas from your OpenAPI specification. Use `exportSchemas: false` to preserve the old behavior.

## v0.27.32

[Section titled “v0.27.32”](#v02732)

### Renamed `Config` interface

[Section titled “Renamed Config interface”](#renamed-config-interface)

This interface is now called `UserConfig`.

## v0.27.29

[Section titled “v0.27.29”](#v02729)

### Renamed `openapi` CLI command

[Section titled “Renamed openapi CLI command”](#renamed-openapi-cli-command)

This command is now called `openapi-ts`.

## v0.27.26

[Section titled “v0.27.26”](#v02726)

### Removed `indent`

[Section titled “Removed indent”](#removed-indent)

This config option has been removed. Use a [code formatter](https://heyapi.dev/openapi-ts/configuration/output#post-process) to modify the generated files code style according to your preferences.

## v0.27.24

[Section titled “v0.27.24”](#v02724)

### Removed `useUnionTypes`

[Section titled “Removed useUnionTypes”](#removed-useuniontypes)

This config option has been removed. Generated types will behave the same as `useUnionTypes: true` before.

## OpenAPI TypeScript Codegen

[Section titled “OpenAPI TypeScript Codegen”](#openapi-typescript-codegen)

`@hey-api/openapi-ts` was originally forked from Ferdi Koomen’s [openapi-typescript-codegen](https://github.com/ferdikoomen/openapi-typescript-codegen). Therefore, we want you to be able to migrate your projects. Migration should be relatively straightforward if you follow the release notes on this page. Start on [v0.27.24](#v0-27-24) and scroll to the release you’re migrating to.
