···25252626## Features
27272828-- NestJS v10 support
2828+- NestJS support
2929- seamless integration with `@hey-api/openapi-ts` ecosystem
3030- type-safe controller methods via `implements`
3131- tag-based grouping for per-controller types
···4848};
4949```
50505151-## Configuration
5252-5353-| Option | Type | Default | Description |
5454-| ------------ | --------- | ------- | ------------------------------------------------------ |
5555-| `groupByTag` | `boolean` | `false` | Group methods by OpenAPI tag into per-controller types |
5656-5751## Output
58525959-The NestJS plugin will generate the following artifacts, depending on the input specification.
6060-6161-## Controller Methods
6262-6363-By default, a single `ControllerMethods` type is generated from all endpoints.
6464-6565-::: code-group
6666-6767-```ts [output]
6868-import type {
6969- ListPetsData,
7070- ListPetsResponse,
7171- ShowPetByIdData,
7272- ShowPetByIdResponse,
7373-} from './types.gen';
7474-7575-export type ControllerMethods = {
7676- createPet: (body: CreatePetData['body']) => Promise<CreatePetResponse>;
7777- listPets: (query?: ListPetsData['query']) => Promise<ListPetsResponse>;
7878- showPetById: (path: ShowPetByIdData['path']) => Promise<ShowPetByIdResponse>;
7979-};
8080-```
8181-8282-```js [config]
8383-export default {
8484- input: 'hey-api/backend', // sign up at app.heyapi.dev
8585- output: 'src/client',
8686- plugins: [
8787- // ...other plugins
8888- {
8989- name: 'nestjs',
9090- },
9191- ],
9292-};
9393-```
9494-9595-:::
9696-9797-## Tag Grouping
9898-9999-When `groupByTag` is `true`, operations are grouped by their first OpenAPI tag into per-controller types. This is ideal for larger APIs with multiple controllers.
5353+The NestJS plugin generates per-tag controller method types from your OpenAPI spec. Operations are grouped by their first OpenAPI tag into separate types like `PetsControllerMethods`, `StoreControllerMethods`, etc.
1005410155::: code-group
10256···11872 output: 'src/client',
11973 plugins: [
12074 // ...other plugins
121121- {
122122- groupByTag: true,
123123- name: 'nestjs',
124124- },
7575+ 'nestjs',
12576 ],
12677};
12778```
···193144194145Methods using `@Res()` for raw response access are incompatible with `implements` because the extra parameter breaks assignability.
195146196196-Operations without tags are grouped under `DefaultControllerMethods` when `groupByTag` is `true`.
147147+Operations without tags are grouped under `DefaultControllerMethods`.
197148198149## API
199150