fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: remove ServiceMethods from NestJS plugin, simplify example app

Remove duplicate ServiceMethods type generation from the NestJS plugin,
keeping only ControllerMethods. Simplify the example app by inlining
controller logic and removing service layer, guards, and dead code.
Add updatePet and deletePet test coverage. Exclude NestJS example and
all .gen directories from root ESLint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+106 -646
+7 -27
docs/openapi-ts/plugins/nest.md
··· 1 1 --- 2 2 title: NestJS Plugin 3 - description: Generate NestJS controller and service interfaces from OpenAPI with type safety. Fully compatible with all core features. 3 + description: Generate NestJS controller interfaces from OpenAPI with type safety. Fully compatible with all core features. 4 4 --- 5 5 6 6 <script setup lang="ts"> ··· 21 21 22 22 [NestJS](https://nestjs.com) is a progressive Node.js framework for building efficient, reliable and scalable server-side applications. 23 23 24 - The NestJS plugin for Hey API generates type-safe controller and service method signatures from your OpenAPI spec, fully compatible with all core features. 24 + The NestJS plugin for Hey API generates type-safe controller method signatures from your OpenAPI spec, fully compatible with all core features. 25 25 26 26 ## Features 27 27 28 28 - NestJS v10 support 29 29 - seamless integration with `@hey-api/openapi-ts` ecosystem 30 30 - type-safe controller methods via `implements` 31 - - service interface types for the DI layer 32 31 - tag-based grouping for per-controller types 33 32 - incremental adoption with `Pick<ControllerMethods, ...>` 34 33 - zero runtime coupling — pure TypeScript types ··· 61 60 62 61 ## Controller Methods 63 62 64 - By default, a single `ControllerMethods` type and a matching `ServiceMethods` type are generated from all endpoints. 63 + By default, a single `ControllerMethods` type is generated from all endpoints. 65 64 66 65 ::: code-group 67 66 ··· 78 77 listPets: (query?: ListPetsData['query']) => Promise<ListPetsResponse>; 79 78 showPetById: (path: ShowPetByIdData['path']) => Promise<ShowPetByIdResponse>; 80 79 }; 81 - 82 - export type ServiceMethods = { 83 - createPet: (body: CreatePetData['body']) => Promise<CreatePetResponse>; 84 - listPets: (query?: ListPetsData['query']) => Promise<ListPetsResponse>; 85 - showPetById: (path: ShowPetByIdData['path']) => Promise<ShowPetByIdResponse>; 86 - }; 87 80 ``` 88 81 89 82 ```js [config] ··· 114 107 showPetById: (path: ShowPetByIdData['path']) => Promise<ShowPetByIdResponse>; 115 108 }; 116 109 117 - export type PetsServiceMethods = { 118 - createPet: (body: CreatePetData['body']) => Promise<CreatePetResponse>; 119 - listPets: (query?: ListPetsData['query']) => Promise<ListPetsResponse>; 120 - showPetById: (path: ShowPetByIdData['path']) => Promise<ShowPetByIdResponse>; 121 - }; 122 - 123 110 export type StoreControllerMethods = { 124 - getInventory: () => Promise<GetInventoryResponse>; 125 - }; 126 - 127 - export type StoreServiceMethods = { 128 111 getInventory: () => Promise<GetInventoryResponse>; 129 112 }; 130 113 ``` ··· 161 144 PetsControllerMethods, 162 145 'listPets' | 'createPet' | 'showPetById' 163 146 > { 164 - constructor(private readonly petsService: PetsService) {} 165 - 166 147 @Get() 167 148 @ApiOperation({ summary: 'List all pets' }) 168 149 @ApiResponse({ status: 200, description: 'A list of pets' }) 169 150 async listPets(@Query() query?: ListPetsData['query']) { 170 - return this.petsService.listPets(query); 151 + // ... 171 152 } 172 153 173 154 @Post() 174 155 @ApiOperation({ summary: 'Create a pet' }) 175 156 @ApiResponse({ status: 201, description: 'Pet created' }) 176 157 async createPet(@Body() body: CreatePetDto) { 177 - return this.petsService.createPet(body); 158 + // ... 178 159 } 179 160 180 161 @Get(':petId') 181 162 @ApiOperation({ summary: 'Find pet by ID' }) 182 163 @ApiResponse({ status: 200, description: 'Pet found' }) 183 164 async showPetById(@Param() path: ShowPetByIdData['path']) { 184 - return this.petsService.showPetById(path); 165 + // ... 185 166 } 186 167 } 187 168 ``` ··· 193 174 - `@nestjs/swagger` for OpenAPI documentation 194 175 - `class-validator` DTOs for request validation 195 176 - `ValidationPipe` with `forbidUnknownValues: true` 196 - - Service layer with dependency injection 197 - - Exception filters and guards 177 + - Exception filters 198 178 - `@darraghor/eslint-plugin-nestjs-typed` for NestJS-specific linting 199 179 200 180 ## Constraints
+2 -1
eslint.config.js
··· 58 58 '**/dist/', 59 59 '**/node_modules/', 60 60 'temp/', 61 - 'dev/.gen/', 61 + '**/.gen/', 62 + 'examples/openapi-ts-nestjs/src/**/*.ts', 62 63 'examples/openapi-ts-openai/src/client/**/*.ts', 63 64 '**/test/generated/', 64 65 '**/__snapshots__/',
-15
examples/openapi-ts-nestjs/src/client/nestjs.gen.ts
··· 25 25 ) => Promise<UpdatePetResponse>; 26 26 }; 27 27 28 - export type PetsServiceMethods = { 29 - createPet: (body: CreatePetData['body']) => Promise<CreatePetResponse>; 30 - deletePet: (path: DeletePetData['path']) => Promise<DeletePetResponse>; 31 - listPets: (query?: ListPetsData['query']) => Promise<ListPetsResponse>; 32 - showPetById: (path: ShowPetByIdData['path']) => Promise<ShowPetByIdResponse>; 33 - updatePet: ( 34 - path: UpdatePetData['path'], 35 - body: UpdatePetData['body'], 36 - ) => Promise<UpdatePetResponse>; 37 - }; 38 - 39 28 export type StoreControllerMethods = { 40 29 getInventory: () => Promise<GetInventoryResponse>; 41 30 }; 42 - 43 - export type StoreServiceMethods = { 44 - getInventory: () => Promise<GetInventoryResponse>; 45 - };
+1
examples/openapi-ts-nestjs/src/common/filters/http-exception.filter.ts
··· 5 5 export class HttpExceptionFilter implements ExceptionFilter { 6 6 catch(exception: HttpException, host: ArgumentsHost) { 7 7 const ctx = host.switchToHttp(); 8 + // Untyped to avoid express/fastify platform dependency 8 9 const response = ctx.getResponse(); 9 10 const status = exception.getStatus(); 10 11 const exceptionResponse = exception.getResponse();
-11
examples/openapi-ts-nestjs/src/common/guards/api-key.guard.ts
··· 1 - import type { CanActivate, ExecutionContext } from '@nestjs/common'; 2 - import { Injectable } from '@nestjs/common'; 3 - 4 - @Injectable() 5 - export class ApiKeyGuard implements CanActivate { 6 - canActivate(context: ExecutionContext): boolean { 7 - const request = context.switchToHttp().getRequest(); 8 - const apiKey = request.headers['x-api-key']; 9 - return apiKey === process.env.API_KEY; 10 - } 11 - }
+54 -9
examples/openapi-ts-nestjs/src/pets/pets.controller.ts
··· 4 4 Delete, 5 5 Get, 6 6 HttpCode, 7 - Inject, 7 + NotFoundException, 8 8 Param, 9 9 Post, 10 10 Put, ··· 15 15 import type { PetsControllerMethods } from '../client/nestjs.gen'; 16 16 import type { 17 17 CreatePetData, 18 + DeletePetData, 18 19 ListPetsData, 20 + Pet, 19 21 ShowPetByIdData, 20 22 UpdatePetData, 21 23 } from '../client/types.gen'; 22 24 import type { CreatePetDto } from './dto/create-pet.dto'; 23 25 import type { UpdatePetDto } from './dto/update-pet.dto'; 24 - import { PetsService } from './pets.service'; 25 26 26 27 @ApiTags('pets') 27 28 @Controller('pets') ··· 29 30 PetsControllerMethods, 30 31 'listPets' | 'createPet' | 'showPetById' | 'updatePet' | 'deletePet' 31 32 > { 32 - constructor(@Inject(PetsService) private readonly petsService: PetsService) {} 33 + private readonly pets: Pet[] = [ 34 + { 35 + id: '550e8400-e29b-41d4-a716-446655440000', 36 + name: 'Fido', 37 + status: 'available', 38 + tag: 'dog', 39 + }, 40 + { 41 + id: '550e8400-e29b-41d4-a716-446655440001', 42 + name: 'Kitty', 43 + status: 'available', 44 + tag: 'cat', 45 + }, 46 + ]; 33 47 34 48 @Get() 35 49 @ApiOperation({ summary: 'List all pets' }) 36 50 @ApiResponse({ description: 'A list of pets', status: 200 }) 37 51 async listPets(@Query() query?: ListPetsData['query']) { 38 - return this.petsService.listPets(query); 52 + const offset = query?.offset ?? 0; 53 + const limit = query?.limit ?? 20; 54 + return this.pets.slice(offset, offset + limit); 39 55 } 40 56 41 57 @Post() ··· 43 59 @ApiResponse({ description: 'Pet created', status: 201 }) 44 60 @ApiResponse({ description: 'Validation error', status: 400 }) 45 61 async createPet(@Body() body: CreatePetDto) { 46 - return this.petsService.createPet(body as CreatePetData['body']); 62 + const pet: Pet = { 63 + id: crypto.randomUUID(), 64 + name: body.name, 65 + status: 'available', 66 + tag: (body as CreatePetData['body']).tag, 67 + }; 68 + this.pets.push(pet); 69 + return pet; 47 70 } 48 71 49 72 @Get(':petId') ··· 51 74 @ApiResponse({ description: 'Pet found', status: 200 }) 52 75 @ApiResponse({ description: 'Pet not found', status: 404 }) 53 76 async showPetById(@Param() path: ShowPetByIdData['path']) { 54 - return this.petsService.showPetById(path); 77 + const pet = this.pets.find((p) => p.id === path.petId); 78 + if (!pet) { 79 + throw new NotFoundException(`Pet ${path.petId} not found`); 80 + } 81 + return pet; 55 82 } 56 83 57 84 @Put(':petId') ··· 60 87 @ApiResponse({ description: 'Validation error', status: 400 }) 61 88 @ApiResponse({ description: 'Pet not found', status: 404 }) 62 89 async updatePet(@Param() path: UpdatePetData['path'], @Body() body: UpdatePetDto) { 63 - return this.petsService.updatePet(path, body as UpdatePetData['body']); 90 + const pet = this.pets.find((p) => p.id === path.petId); 91 + if (!pet) { 92 + throw new NotFoundException(`Pet ${path.petId} not found`); 93 + } 94 + const update = body as UpdatePetData['body']; 95 + if (update.name !== undefined) { 96 + pet.name = update.name; 97 + } 98 + if (update.tag !== undefined) { 99 + pet.tag = update.tag; 100 + } 101 + if (update.status !== undefined) { 102 + pet.status = update.status; 103 + } 104 + return pet; 64 105 } 65 106 66 107 @Delete(':petId') ··· 68 109 @ApiOperation({ summary: 'Delete a pet' }) 69 110 @ApiResponse({ description: 'Pet deleted', status: 204 }) 70 111 @ApiResponse({ description: 'Pet not found', status: 404 }) 71 - async deletePet(@Param() path: ShowPetByIdData['path']) { 72 - return this.petsService.deletePet(path); 112 + async deletePet(@Param() path: DeletePetData['path']) { 113 + const index = this.pets.findIndex((p) => p.id === path.petId); 114 + if (index === -1) { 115 + throw new NotFoundException(`Pet ${path.petId} not found`); 116 + } 117 + this.pets.splice(index, 1); 73 118 } 74 119 }
-2
examples/openapi-ts-nestjs/src/pets/pets.module.ts
··· 1 1 import { Module } from '@nestjs/common'; 2 2 3 3 import { PetsController } from './pets.controller'; 4 - import { PetsService } from './pets.service'; 5 4 6 5 @Module({ 7 6 controllers: [PetsController], 8 - providers: [PetsService], 9 7 }) 10 8 export class PetsModule {}
-77
examples/openapi-ts-nestjs/src/pets/pets.service.ts
··· 1 - import { Injectable, NotFoundException } from '@nestjs/common'; 2 - 3 - import type { 4 - CreatePetData, 5 - ListPetsData, 6 - Pet, 7 - ShowPetByIdData, 8 - UpdatePetData, 9 - } from '../client/types.gen'; 10 - 11 - @Injectable() 12 - export class PetsService { 13 - private readonly pets: Pet[] = [ 14 - { 15 - id: '550e8400-e29b-41d4-a716-446655440000', 16 - name: 'Fido', 17 - status: 'available', 18 - tag: 'dog', 19 - }, 20 - { 21 - id: '550e8400-e29b-41d4-a716-446655440001', 22 - name: 'Kitty', 23 - status: 'available', 24 - tag: 'cat', 25 - }, 26 - ]; 27 - 28 - async listPets(query?: ListPetsData['query']): Promise<Pet[]> { 29 - const offset = query?.offset ?? 0; 30 - const limit = query?.limit ?? 20; 31 - return this.pets.slice(offset, offset + limit); 32 - } 33 - 34 - async createPet(body: CreatePetData['body']): Promise<Pet> { 35 - const pet: Pet = { 36 - id: crypto.randomUUID(), 37 - name: body.name, 38 - status: 'available', 39 - tag: body.tag, 40 - }; 41 - this.pets.push(pet); 42 - return pet; 43 - } 44 - 45 - async showPetById(path: ShowPetByIdData['path']): Promise<Pet> { 46 - const pet = this.pets.find((p) => p.id === path.petId); 47 - if (!pet) { 48 - throw new NotFoundException(`Pet ${path.petId} not found`); 49 - } 50 - return pet; 51 - } 52 - 53 - async updatePet(path: UpdatePetData['path'], body: UpdatePetData['body']): Promise<Pet> { 54 - const pet = this.pets.find((p) => p.id === path.petId); 55 - if (!pet) { 56 - throw new NotFoundException(`Pet ${path.petId} not found`); 57 - } 58 - if (body.name !== undefined) { 59 - pet.name = body.name; 60 - } 61 - if (body.tag !== undefined) { 62 - pet.tag = body.tag; 63 - } 64 - if (body.status !== undefined) { 65 - pet.status = body.status; 66 - } 67 - return pet; 68 - } 69 - 70 - async deletePet(path: ShowPetByIdData['path']): Promise<void> { 71 - const index = this.pets.findIndex((p) => p.id === path.petId); 72 - if (index === -1) { 73 - throw new NotFoundException(`Pet ${path.petId} not found`); 74 - } 75 - this.pets.splice(index, 1); 76 - } 77 - }
+6 -5
examples/openapi-ts-nestjs/src/store/store.controller.ts
··· 1 - import { Controller, Get, Inject } from '@nestjs/common'; 1 + import { Controller, Get } from '@nestjs/common'; 2 2 import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger'; 3 3 4 4 import type { StoreControllerMethods } from '../client/nestjs.gen'; 5 - import { StoreService } from './store.service'; 6 5 7 6 @ApiTags('store') 8 7 @Controller('store') 9 8 export class StoreController implements Pick<StoreControllerMethods, 'getInventory'> { 10 - constructor(@Inject(StoreService) private readonly storeService: StoreService) {} 11 - 12 9 @Get('inventory') 13 10 @ApiOperation({ summary: 'Returns pet inventories by status' }) 14 11 @ApiResponse({ description: 'Successful operation', status: 200 }) 15 12 async getInventory() { 16 - return this.storeService.getInventory(); 13 + return { 14 + available: 10, 15 + pending: 3, 16 + sold: 5, 17 + }; 17 18 } 18 19 }
-2
examples/openapi-ts-nestjs/src/store/store.module.ts
··· 1 1 import { Module } from '@nestjs/common'; 2 2 3 3 import { StoreController } from './store.controller'; 4 - import { StoreService } from './store.service'; 5 4 6 5 @Module({ 7 6 controllers: [StoreController], 8 - providers: [StoreService], 9 7 }) 10 8 export class StoreModule {}
-12
examples/openapi-ts-nestjs/src/store/store.service.ts
··· 1 - import { Injectable } from '@nestjs/common'; 2 - 3 - @Injectable() 4 - export class StoreService { 5 - async getInventory(): Promise<Record<string, number>> { 6 - return { 7 - available: 10, 8 - pending: 3, 9 - sold: 5, 10 - }; 11 - } 12 - }
+35 -38
examples/openapi-ts-nestjs/test/pets.test.ts
··· 1 1 import type { INestApplication } from '@nestjs/common'; 2 2 import { Test } from '@nestjs/testing'; 3 3 import { AppModule } from 'src/app.module'; 4 - import { createPet, getInventory, listPets, showPetById } from 'src/client'; 4 + import { createPet, deletePet, getInventory, listPets, showPetById, updatePet } from 'src/client'; 5 5 import { client } from 'src/client/client.gen'; 6 6 7 - describe('PetsController', () => { 8 - let app: INestApplication; 7 + let app: INestApplication; 9 8 10 - beforeAll(async () => { 11 - const moduleRef = await Test.createTestingModule({ 12 - imports: [AppModule], 13 - }).compile(); 9 + beforeAll(async () => { 10 + const moduleRef = await Test.createTestingModule({ 11 + imports: [AppModule], 12 + }).compile(); 14 13 15 - app = moduleRef.createNestApplication(); 16 - await app.init(); 17 - await app.listen(0); 14 + app = moduleRef.createNestApplication(); 15 + await app.init(); 16 + await app.listen(0); 18 17 19 - const address = app.getHttpServer().address(); 20 - const baseUrl = `http://localhost:${address.port}`; 21 - client.setConfig({ baseUrl }); 22 - }); 18 + const address = app.getHttpServer().address(); 19 + const baseUrl = `http://localhost:${address.port}`; 20 + client.setConfig({ baseUrl }); 21 + }); 23 22 24 - afterAll(async () => { 25 - await app.close(); 26 - }); 23 + afterAll(async () => { 24 + await app.close(); 25 + }); 27 26 27 + describe('PetsController', () => { 28 28 test('listPets', async () => { 29 29 const result = await listPets({ client }); 30 30 expect(result.response.status).toBe(200); ··· 34 34 test('showPetById', async () => { 35 35 const result = await showPetById({ 36 36 client, 37 - path: { 38 - petId: '550e8400-e29b-41d4-a716-446655440000', 39 - }, 37 + path: { petId: '550e8400-e29b-41d4-a716-446655440000' }, 40 38 }); 41 39 expect(result.response.status).toBe(200); 42 40 }); ··· 47 45 client, 48 46 }); 49 47 expect(result.response.status).toBe(201); 48 + expect(result.data).toMatchObject({ name: 'Buddy' }); 50 49 }); 51 - }); 52 50 53 - describe('StoreController', () => { 54 - let app: INestApplication; 55 - 56 - beforeAll(async () => { 57 - const moduleRef = await Test.createTestingModule({ 58 - imports: [AppModule], 59 - }).compile(); 60 - 61 - app = moduleRef.createNestApplication(); 62 - await app.init(); 63 - await app.listen(0); 64 - 65 - const address = app.getHttpServer().address(); 66 - const baseUrl = `http://localhost:${address.port}`; 67 - client.setConfig({ baseUrl }); 51 + test('updatePet', async () => { 52 + const result = await updatePet({ 53 + body: { name: 'Fido Updated' }, 54 + client, 55 + path: { petId: '550e8400-e29b-41d4-a716-446655440000' }, 56 + }); 57 + expect(result.response.status).toBe(200); 58 + expect(result.data).toMatchObject({ name: 'Fido Updated' }); 68 59 }); 69 60 70 - afterAll(async () => { 71 - await app.close(); 61 + test('deletePet', async () => { 62 + const result = await deletePet({ 63 + client, 64 + path: { petId: '550e8400-e29b-41d4-a716-446655440001' }, 65 + }); 66 + expect(result.response.status).toBe(204); 72 67 }); 68 + }); 73 69 70 + describe('StoreController', () => { 74 71 test('getInventory', async () => { 75 72 const result = await getInventory({ client }); 76 73 expect(result.response.status).toBe(200);
-37
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/nestjs/default/nestjs.gen.ts
··· 38 38 nonAsciiæøåÆøÅöôêÊ字符串: (query: NonAsciiæøåÆøÅöôêÊ字符串Data['query']) => Promise<NonAsciiæøåÆøÅöôêÊ字符串Response>; 39 39 postApiVbyApiVersionBody: (body: PostApiVbyApiVersionBodyData['body']) => Promise<PostApiVbyApiVersionBodyResponse>; 40 40 }; 41 - 42 - export type ServiceMethods = { 43 - serviceWithEmptyTag: () => Promise<void>; 44 - patchApiVbyApiVersionNoTag: () => Promise<void>; 45 - fooWow: () => Promise<void>; 46 - deleteCallWithoutParametersAndResponse: () => Promise<void>; 47 - getCallWithoutParametersAndResponse: () => Promise<void>; 48 - headCallWithoutParametersAndResponse: () => Promise<void>; 49 - optionsCallWithoutParametersAndResponse: () => Promise<void>; 50 - patchCallWithoutParametersAndResponse: () => Promise<void>; 51 - postCallWithoutParametersAndResponse: () => Promise<void>; 52 - putCallWithoutParametersAndResponse: () => Promise<void>; 53 - callWithDescriptions: (query?: CallWithDescriptionsData['query']) => Promise<void>; 54 - callWithParameters: (path: CallWithParametersData['path'], query: CallWithParametersData['query'], headers: CallWithParametersData['headers']) => Promise<void>; 55 - callWithWeirdParameterNames: (path: CallWithWeirdParameterNamesData['path'], query: CallWithWeirdParameterNamesData['query'], body: CallWithWeirdParameterNamesData['body'], headers: CallWithWeirdParameterNamesData['headers']) => Promise<void>; 56 - callWithDefaultParameters: (query: CallWithDefaultParametersData['query']) => Promise<void>; 57 - callWithDefaultOptionalParameters: (query?: CallWithDefaultOptionalParametersData['query']) => Promise<void>; 58 - callToTestOrderOfParams: (query: CallToTestOrderOfParamsData['query']) => Promise<void>; 59 - duplicateName: () => Promise<void>; 60 - duplicateName2: () => Promise<void>; 61 - duplicateName3: () => Promise<void>; 62 - duplicateName4: () => Promise<void>; 63 - callWithNoContentResponse: () => Promise<void>; 64 - callWithResponseAndNoContentResponse: () => Promise<CallWithResponseAndNoContentResponseResponse>; 65 - dummyA: () => Promise<void>; 66 - dummyB: () => Promise<void>; 67 - callWithResponse: () => Promise<CallWithResponseResponse>; 68 - callWithDuplicateResponses: () => Promise<CallWithDuplicateResponsesResponse>; 69 - callWithResponses: () => Promise<CallWithResponsesResponse>; 70 - collectionFormat: (query: CollectionFormatData['query']) => Promise<void>; 71 - types: (query: TypesData['query'], path?: TypesData['path']) => Promise<TypesResponse>; 72 - complexTypes: (query: ComplexTypesData['query']) => Promise<ComplexTypesResponse>; 73 - callWithResultFromHeader: () => Promise<void>; 74 - testErrorCode: (query: TestErrorCodeData['query']) => Promise<void>; 75 - nonAsciiæøåÆøÅöôêÊ字符串: (query: NonAsciiæøåÆøÅöôêÊ字符串Data['query']) => Promise<NonAsciiæøåÆøÅöôêÊ字符串Response>; 76 - postApiVbyApiVersionBody: (body: PostApiVbyApiVersionBodyData['body']) => Promise<PostApiVbyApiVersionBodyResponse>; 77 - };
-79
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/nestjs/group-by-tag/nestjs.gen.ts
··· 9 9 postApiVbyApiVersionBody: (body: PostApiVbyApiVersionBodyData['body']) => Promise<PostApiVbyApiVersionBodyResponse>; 10 10 }; 11 11 12 - export type DefaultServiceMethods = { 13 - serviceWithEmptyTag: () => Promise<void>; 14 - patchApiVbyApiVersionNoTag: () => Promise<void>; 15 - fooWow: () => Promise<void>; 16 - postApiVbyApiVersionBody: (body: PostApiVbyApiVersionBodyData['body']) => Promise<PostApiVbyApiVersionBodyResponse>; 17 - }; 18 - 19 12 export type SimpleControllerMethods = { 20 13 deleteCallWithoutParametersAndResponse: () => Promise<void>; 21 14 getCallWithoutParametersAndResponse: () => Promise<void>; ··· 26 19 putCallWithoutParametersAndResponse: () => Promise<void>; 27 20 }; 28 21 29 - export type SimpleServiceMethods = { 30 - deleteCallWithoutParametersAndResponse: () => Promise<void>; 31 - getCallWithoutParametersAndResponse: () => Promise<void>; 32 - headCallWithoutParametersAndResponse: () => Promise<void>; 33 - optionsCallWithoutParametersAndResponse: () => Promise<void>; 34 - patchCallWithoutParametersAndResponse: () => Promise<void>; 35 - postCallWithoutParametersAndResponse: () => Promise<void>; 36 - putCallWithoutParametersAndResponse: () => Promise<void>; 37 - }; 38 - 39 22 export type DescriptionsControllerMethods = { 40 23 callWithDescriptions: (query?: CallWithDescriptionsData['query']) => Promise<void>; 41 24 }; 42 25 43 - export type DescriptionsServiceMethods = { 44 - callWithDescriptions: (query?: CallWithDescriptionsData['query']) => Promise<void>; 45 - }; 46 - 47 26 export type ParametersControllerMethods = { 48 27 callWithParameters: (path: CallWithParametersData['path'], query: CallWithParametersData['query'], headers: CallWithParametersData['headers']) => Promise<void>; 49 28 callWithWeirdParameterNames: (path: CallWithWeirdParameterNamesData['path'], query: CallWithWeirdParameterNamesData['query'], body: CallWithWeirdParameterNamesData['body'], headers: CallWithWeirdParameterNamesData['headers']) => Promise<void>; 50 29 }; 51 30 52 - export type ParametersServiceMethods = { 53 - callWithParameters: (path: CallWithParametersData['path'], query: CallWithParametersData['query'], headers: CallWithParametersData['headers']) => Promise<void>; 54 - callWithWeirdParameterNames: (path: CallWithWeirdParameterNamesData['path'], query: CallWithWeirdParameterNamesData['query'], body: CallWithWeirdParameterNamesData['body'], headers: CallWithWeirdParameterNamesData['headers']) => Promise<void>; 55 - }; 56 - 57 31 export type DefaultsControllerMethods = { 58 32 callWithDefaultParameters: (query: CallWithDefaultParametersData['query']) => Promise<void>; 59 33 callWithDefaultOptionalParameters: (query?: CallWithDefaultOptionalParametersData['query']) => Promise<void>; 60 34 callToTestOrderOfParams: (query: CallToTestOrderOfParamsData['query']) => Promise<void>; 61 35 }; 62 36 63 - export type DefaultsServiceMethods = { 64 - callWithDefaultParameters: (query: CallWithDefaultParametersData['query']) => Promise<void>; 65 - callWithDefaultOptionalParameters: (query?: CallWithDefaultOptionalParametersData['query']) => Promise<void>; 66 - callToTestOrderOfParams: (query: CallToTestOrderOfParamsData['query']) => Promise<void>; 67 - }; 68 - 69 37 export type DuplicateControllerMethods = { 70 38 duplicateName: () => Promise<void>; 71 39 duplicateName2: () => Promise<void>; ··· 73 41 duplicateName4: () => Promise<void>; 74 42 }; 75 43 76 - export type DuplicateServiceMethods = { 77 - duplicateName: () => Promise<void>; 78 - duplicateName2: () => Promise<void>; 79 - duplicateName3: () => Promise<void>; 80 - duplicateName4: () => Promise<void>; 81 - }; 82 - 83 44 export type NoContentControllerMethods = { 84 45 callWithNoContentResponse: () => Promise<void>; 85 46 }; 86 47 87 - export type NoContentServiceMethods = { 88 - callWithNoContentResponse: () => Promise<void>; 89 - }; 90 - 91 48 export type ResponseControllerMethods = { 92 - callWithResponseAndNoContentResponse: () => Promise<CallWithResponseAndNoContentResponseResponse>; 93 - callWithResponse: () => Promise<CallWithResponseResponse>; 94 - callWithDuplicateResponses: () => Promise<CallWithDuplicateResponsesResponse>; 95 - callWithResponses: () => Promise<CallWithResponsesResponse>; 96 - }; 97 - 98 - export type ResponseServiceMethods = { 99 49 callWithResponseAndNoContentResponse: () => Promise<CallWithResponseAndNoContentResponseResponse>; 100 50 callWithResponse: () => Promise<CallWithResponseResponse>; 101 51 callWithDuplicateResponses: () => Promise<CallWithDuplicateResponsesResponse>; ··· 107 57 dummyB: () => Promise<void>; 108 58 }; 109 59 110 - export type MultipleTags1ServiceMethods = { 111 - dummyA: () => Promise<void>; 112 - dummyB: () => Promise<void>; 113 - }; 114 - 115 60 export type CollectionFormatControllerMethods = { 116 61 collectionFormat: (query: CollectionFormatData['query']) => Promise<void>; 117 62 }; 118 63 119 - export type CollectionFormatServiceMethods = { 120 - collectionFormat: (query: CollectionFormatData['query']) => Promise<void>; 121 - }; 122 - 123 64 export type TypesControllerMethods = { 124 65 types: (query: TypesData['query'], path?: TypesData['path']) => Promise<TypesResponse>; 125 66 }; 126 67 127 - export type TypesServiceMethods = { 128 - types: (query: TypesData['query'], path?: TypesData['path']) => Promise<TypesResponse>; 129 - }; 130 - 131 68 export type ComplexControllerMethods = { 132 69 complexTypes: (query: ComplexTypesData['query']) => Promise<ComplexTypesResponse>; 133 70 }; 134 71 135 - export type ComplexServiceMethods = { 136 - complexTypes: (query: ComplexTypesData['query']) => Promise<ComplexTypesResponse>; 137 - }; 138 - 139 72 export type HeaderControllerMethods = { 140 73 callWithResultFromHeader: () => Promise<void>; 141 74 }; 142 75 143 - export type HeaderServiceMethods = { 144 - callWithResultFromHeader: () => Promise<void>; 145 - }; 146 - 147 76 export type ErrorControllerMethods = { 148 - testErrorCode: (query: TestErrorCodeData['query']) => Promise<void>; 149 - }; 150 - 151 - export type ErrorServiceMethods = { 152 77 testErrorCode: (query: TestErrorCodeData['query']) => Promise<void>; 153 78 }; 154 79 155 80 export type NonAsciiÆøåÆøÅöôêÊControllerMethods = { 156 81 nonAsciiæøåÆøÅöôêÊ字符串: (query: NonAsciiæøåÆøÅöôêÊ字符串Data['query']) => Promise<NonAsciiæøåÆøÅöôêÊ字符串Response>; 157 82 }; 158 - 159 - export type NonAsciiÆøåÆøÅöôêÊServiceMethods = { 160 - nonAsciiæøåÆøÅöôêÊ字符串: (query: NonAsciiæøåÆøÅöôêÊ字符串Data['query']) => Promise<NonAsciiæøåÆøÅöôêÊ字符串Response>; 161 - };
-51
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/nestjs/default/nestjs.gen.ts
··· 52 52 nonAsciiæøåÆøÅöôêÊ字符串: (query: NonAsciiæøåÆøÅöôêÊ字符串Data['query']) => Promise<NonAsciiæøåÆøÅöôêÊ字符串Response>; 53 53 putWithFormUrlEncoded: (body: PutWithFormUrlEncodedData['body']) => Promise<void>; 54 54 }; 55 - 56 - export type ServiceMethods = { 57 - export: () => Promise<void>; 58 - patchApiVbyApiVersionNoTag: () => Promise<void>; 59 - import: (body: ImportData['body']) => Promise<ImportResponse>; 60 - fooWow: () => Promise<void>; 61 - apiVVersionODataControllerCount: () => Promise<ApiVVersionODataControllerCountResponse>; 62 - getApiVbyApiVersionSimpleOperation: (path: GetApiVbyApiVersionSimpleOperationData['path']) => Promise<GetApiVbyApiVersionSimpleOperationResponse>; 63 - deleteCallWithoutParametersAndResponse: () => Promise<void>; 64 - getCallWithoutParametersAndResponse: () => Promise<void>; 65 - headCallWithoutParametersAndResponse: () => Promise<void>; 66 - optionsCallWithoutParametersAndResponse: () => Promise<void>; 67 - patchCallWithoutParametersAndResponse: () => Promise<void>; 68 - postCallWithoutParametersAndResponse: () => Promise<void>; 69 - putCallWithoutParametersAndResponse: () => Promise<void>; 70 - deleteFoo: (path: DeleteFooData3['path'], headers: DeleteFooData3['headers']) => Promise<void>; 71 - callWithDescriptions: (query?: CallWithDescriptionsData['query']) => Promise<void>; 72 - deprecatedCall: (headers: DeprecatedCallData['headers']) => Promise<void>; 73 - callWithParameters: (path: CallWithParametersData['path'], query: CallWithParametersData['query'], body: CallWithParametersData['body'], headers: CallWithParametersData['headers']) => Promise<void>; 74 - callWithWeirdParameterNames: (path: CallWithWeirdParameterNamesData['path'], query: CallWithWeirdParameterNamesData['query'], body: CallWithWeirdParameterNamesData['body'], headers: CallWithWeirdParameterNamesData['headers']) => Promise<void>; 75 - getCallWithOptionalParam: (body: GetCallWithOptionalParamData['body'], query?: GetCallWithOptionalParamData['query']) => Promise<void>; 76 - postCallWithOptionalParam: (query: PostCallWithOptionalParamData['query'], body?: PostCallWithOptionalParamData['body']) => Promise<PostCallWithOptionalParamResponse>; 77 - postApiVbyApiVersionRequestBody: (query?: PostApiVbyApiVersionRequestBodyData['query'], body?: PostApiVbyApiVersionRequestBodyData['body']) => Promise<void>; 78 - postApiVbyApiVersionFormData: (query?: PostApiVbyApiVersionFormDataData['query'], body?: PostApiVbyApiVersionFormDataData['body']) => Promise<void>; 79 - callWithDefaultParameters: (query?: CallWithDefaultParametersData['query']) => Promise<void>; 80 - callWithDefaultOptionalParameters: (query?: CallWithDefaultOptionalParametersData['query']) => Promise<void>; 81 - callToTestOrderOfParams: (query: CallToTestOrderOfParamsData['query']) => Promise<void>; 82 - duplicateName: () => Promise<void>; 83 - duplicateName2: () => Promise<void>; 84 - duplicateName3: () => Promise<void>; 85 - duplicateName4: () => Promise<void>; 86 - callWithNoContentResponse: () => Promise<CallWithNoContentResponseResponse>; 87 - callWithResponseAndNoContentResponse: () => Promise<CallWithResponseAndNoContentResponseResponse>; 88 - dummyA: () => Promise<DummyAResponse>; 89 - dummyB: () => Promise<DummyBResponse>; 90 - callWithResponse: () => Promise<CallWithResponseResponse>; 91 - callWithDuplicateResponses: () => Promise<CallWithDuplicateResponsesResponse>; 92 - callWithResponses: () => Promise<CallWithResponsesResponse>; 93 - collectionFormat: (query: CollectionFormatData['query']) => Promise<void>; 94 - types: (query: TypesData['query'], path?: TypesData['path']) => Promise<TypesResponse>; 95 - uploadFile: (path: UploadFileData['path'], body: UploadFileData['body']) => Promise<UploadFileResponse>; 96 - fileResponse: (path: FileResponseData['path']) => Promise<FileResponseResponse>; 97 - complexTypes: (query: ComplexTypesData['query']) => Promise<ComplexTypesResponse>; 98 - multipartResponse: () => Promise<MultipartResponseResponse>; 99 - multipartRequest: (body?: MultipartRequestData['body']) => Promise<void>; 100 - complexParams: (path: ComplexParamsData['path'], body?: ComplexParamsData['body']) => Promise<ComplexParamsResponse>; 101 - callWithResultFromHeader: () => Promise<void>; 102 - testErrorCode: (query: TestErrorCodeData['query']) => Promise<void>; 103 - nonAsciiæøåÆøÅöôêÊ字符串: (query: NonAsciiæøåÆøÅöôêÊ字符串Data['query']) => Promise<NonAsciiæøåÆøÅöôêÊ字符串Response>; 104 - putWithFormUrlEncoded: (body: PutWithFormUrlEncodedData['body']) => Promise<void>; 105 - };
-111
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/nestjs/group-by-tag/nestjs.gen.ts
··· 10 10 getApiVbyApiVersionSimpleOperation: (path: GetApiVbyApiVersionSimpleOperationData['path']) => Promise<GetApiVbyApiVersionSimpleOperationResponse>; 11 11 }; 12 12 13 - export type DefaultServiceMethods = { 14 - export: () => Promise<void>; 15 - patchApiVbyApiVersionNoTag: () => Promise<void>; 16 - import: (body: ImportData['body']) => Promise<ImportResponse>; 17 - fooWow: () => Promise<void>; 18 - getApiVbyApiVersionSimpleOperation: (path: GetApiVbyApiVersionSimpleOperationData['path']) => Promise<GetApiVbyApiVersionSimpleOperationResponse>; 19 - }; 20 - 21 13 export type SimpleControllerMethods = { 22 14 apiVVersionODataControllerCount: () => Promise<ApiVVersionODataControllerCountResponse>; 23 15 deleteCallWithoutParametersAndResponse: () => Promise<void>; ··· 29 21 putCallWithoutParametersAndResponse: () => Promise<void>; 30 22 }; 31 23 32 - export type SimpleServiceMethods = { 33 - apiVVersionODataControllerCount: () => Promise<ApiVVersionODataControllerCountResponse>; 34 - deleteCallWithoutParametersAndResponse: () => Promise<void>; 35 - getCallWithoutParametersAndResponse: () => Promise<void>; 36 - headCallWithoutParametersAndResponse: () => Promise<void>; 37 - optionsCallWithoutParametersAndResponse: () => Promise<void>; 38 - patchCallWithoutParametersAndResponse: () => Promise<void>; 39 - postCallWithoutParametersAndResponse: () => Promise<void>; 40 - putCallWithoutParametersAndResponse: () => Promise<void>; 41 - }; 42 - 43 24 export type ParametersControllerMethods = { 44 25 deleteFoo: (path: DeleteFooData3['path'], headers: DeleteFooData3['headers']) => Promise<void>; 45 26 callWithParameters: (path: CallWithParametersData['path'], query: CallWithParametersData['query'], body: CallWithParametersData['body'], headers: CallWithParametersData['headers']) => Promise<void>; ··· 48 29 postCallWithOptionalParam: (query: PostCallWithOptionalParamData['query'], body?: PostCallWithOptionalParamData['body']) => Promise<PostCallWithOptionalParamResponse>; 49 30 }; 50 31 51 - export type ParametersServiceMethods = { 52 - deleteFoo: (path: DeleteFooData3['path'], headers: DeleteFooData3['headers']) => Promise<void>; 53 - callWithParameters: (path: CallWithParametersData['path'], query: CallWithParametersData['query'], body: CallWithParametersData['body'], headers: CallWithParametersData['headers']) => Promise<void>; 54 - callWithWeirdParameterNames: (path: CallWithWeirdParameterNamesData['path'], query: CallWithWeirdParameterNamesData['query'], body: CallWithWeirdParameterNamesData['body'], headers: CallWithWeirdParameterNamesData['headers']) => Promise<void>; 55 - getCallWithOptionalParam: (body: GetCallWithOptionalParamData['body'], query?: GetCallWithOptionalParamData['query']) => Promise<void>; 56 - postCallWithOptionalParam: (query: PostCallWithOptionalParamData['query'], body?: PostCallWithOptionalParamData['body']) => Promise<PostCallWithOptionalParamResponse>; 57 - }; 58 - 59 32 export type DescriptionsControllerMethods = { 60 33 callWithDescriptions: (query?: CallWithDescriptionsData['query']) => Promise<void>; 61 34 }; 62 35 63 - export type DescriptionsServiceMethods = { 64 - callWithDescriptions: (query?: CallWithDescriptionsData['query']) => Promise<void>; 65 - }; 66 - 67 36 export type DeprecatedControllerMethods = { 68 - deprecatedCall: (headers: DeprecatedCallData['headers']) => Promise<void>; 69 - }; 70 - 71 - export type DeprecatedServiceMethods = { 72 37 deprecatedCall: (headers: DeprecatedCallData['headers']) => Promise<void>; 73 38 }; 74 39 ··· 76 41 postApiVbyApiVersionRequestBody: (query?: PostApiVbyApiVersionRequestBodyData['query'], body?: PostApiVbyApiVersionRequestBodyData['body']) => Promise<void>; 77 42 }; 78 43 79 - export type RequestBodyServiceMethods = { 80 - postApiVbyApiVersionRequestBody: (query?: PostApiVbyApiVersionRequestBodyData['query'], body?: PostApiVbyApiVersionRequestBodyData['body']) => Promise<void>; 81 - }; 82 - 83 44 export type FormDataControllerMethods = { 84 45 postApiVbyApiVersionFormData: (query?: PostApiVbyApiVersionFormDataData['query'], body?: PostApiVbyApiVersionFormDataData['body']) => Promise<void>; 85 46 }; 86 47 87 - export type FormDataServiceMethods = { 88 - postApiVbyApiVersionFormData: (query?: PostApiVbyApiVersionFormDataData['query'], body?: PostApiVbyApiVersionFormDataData['body']) => Promise<void>; 89 - }; 90 - 91 48 export type DefaultsControllerMethods = { 92 - callWithDefaultParameters: (query?: CallWithDefaultParametersData['query']) => Promise<void>; 93 - callWithDefaultOptionalParameters: (query?: CallWithDefaultOptionalParametersData['query']) => Promise<void>; 94 - callToTestOrderOfParams: (query: CallToTestOrderOfParamsData['query']) => Promise<void>; 95 - }; 96 - 97 - export type DefaultsServiceMethods = { 98 49 callWithDefaultParameters: (query?: CallWithDefaultParametersData['query']) => Promise<void>; 99 50 callWithDefaultOptionalParameters: (query?: CallWithDefaultOptionalParametersData['query']) => Promise<void>; 100 51 callToTestOrderOfParams: (query: CallToTestOrderOfParamsData['query']) => Promise<void>; 101 52 }; 102 53 103 54 export type DuplicateControllerMethods = { 104 - duplicateName: () => Promise<void>; 105 - duplicateName2: () => Promise<void>; 106 - duplicateName3: () => Promise<void>; 107 - duplicateName4: () => Promise<void>; 108 - }; 109 - 110 - export type DuplicateServiceMethods = { 111 55 duplicateName: () => Promise<void>; 112 56 duplicateName2: () => Promise<void>; 113 57 duplicateName3: () => Promise<void>; ··· 118 62 callWithNoContentResponse: () => Promise<CallWithNoContentResponseResponse>; 119 63 }; 120 64 121 - export type NoContentServiceMethods = { 122 - callWithNoContentResponse: () => Promise<CallWithNoContentResponseResponse>; 123 - }; 124 - 125 65 export type ResponseControllerMethods = { 126 66 callWithResponseAndNoContentResponse: () => Promise<CallWithResponseAndNoContentResponseResponse>; 127 67 callWithResponse: () => Promise<CallWithResponseResponse>; ··· 129 69 callWithResponses: () => Promise<CallWithResponsesResponse>; 130 70 }; 131 71 132 - export type ResponseServiceMethods = { 133 - callWithResponseAndNoContentResponse: () => Promise<CallWithResponseAndNoContentResponseResponse>; 134 - callWithResponse: () => Promise<CallWithResponseResponse>; 135 - callWithDuplicateResponses: () => Promise<CallWithDuplicateResponsesResponse>; 136 - callWithResponses: () => Promise<CallWithResponsesResponse>; 137 - }; 138 - 139 72 export type MultipleTags1ControllerMethods = { 140 73 dummyA: () => Promise<DummyAResponse>; 141 74 dummyB: () => Promise<DummyBResponse>; 142 75 }; 143 76 144 - export type MultipleTags1ServiceMethods = { 145 - dummyA: () => Promise<DummyAResponse>; 146 - dummyB: () => Promise<DummyBResponse>; 147 - }; 148 - 149 77 export type CollectionFormatControllerMethods = { 150 78 collectionFormat: (query: CollectionFormatData['query']) => Promise<void>; 151 79 }; 152 80 153 - export type CollectionFormatServiceMethods = { 154 - collectionFormat: (query: CollectionFormatData['query']) => Promise<void>; 155 - }; 156 - 157 81 export type TypesControllerMethods = { 158 82 types: (query: TypesData['query'], path?: TypesData['path']) => Promise<TypesResponse>; 159 83 }; 160 84 161 - export type TypesServiceMethods = { 162 - types: (query: TypesData['query'], path?: TypesData['path']) => Promise<TypesResponse>; 163 - }; 164 - 165 85 export type UploadControllerMethods = { 166 - uploadFile: (path: UploadFileData['path'], body: UploadFileData['body']) => Promise<UploadFileResponse>; 167 - }; 168 - 169 - export type UploadServiceMethods = { 170 86 uploadFile: (path: UploadFileData['path'], body: UploadFileData['body']) => Promise<UploadFileResponse>; 171 87 }; 172 88 ··· 174 90 fileResponse: (path: FileResponseData['path']) => Promise<FileResponseResponse>; 175 91 }; 176 92 177 - export type FileResponseServiceMethods = { 178 - fileResponse: (path: FileResponseData['path']) => Promise<FileResponseResponse>; 179 - }; 180 - 181 93 export type ComplexControllerMethods = { 182 94 complexTypes: (query: ComplexTypesData['query']) => Promise<ComplexTypesResponse>; 183 95 complexParams: (path: ComplexParamsData['path'], body?: ComplexParamsData['body']) => Promise<ComplexParamsResponse>; 184 96 }; 185 97 186 - export type ComplexServiceMethods = { 187 - complexTypes: (query: ComplexTypesData['query']) => Promise<ComplexTypesResponse>; 188 - complexParams: (path: ComplexParamsData['path'], body?: ComplexParamsData['body']) => Promise<ComplexParamsResponse>; 189 - }; 190 - 191 98 export type MultipartControllerMethods = { 192 - multipartResponse: () => Promise<MultipartResponseResponse>; 193 - multipartRequest: (body?: MultipartRequestData['body']) => Promise<void>; 194 - }; 195 - 196 - export type MultipartServiceMethods = { 197 99 multipartResponse: () => Promise<MultipartResponseResponse>; 198 100 multipartRequest: (body?: MultipartRequestData['body']) => Promise<void>; 199 101 }; ··· 202 104 callWithResultFromHeader: () => Promise<void>; 203 105 }; 204 106 205 - export type HeaderServiceMethods = { 206 - callWithResultFromHeader: () => Promise<void>; 207 - }; 208 - 209 107 export type ErrorControllerMethods = { 210 108 testErrorCode: (query: TestErrorCodeData['query']) => Promise<void>; 211 109 }; 212 110 213 - export type ErrorServiceMethods = { 214 - testErrorCode: (query: TestErrorCodeData['query']) => Promise<void>; 215 - }; 216 - 217 111 export type NonAsciiÆøåÆøÅöôêÊControllerMethods = { 218 112 nonAsciiæøåÆøÅöôêÊ字符串: (query: NonAsciiæøåÆøÅöôêÊ字符串Data['query']) => Promise<NonAsciiæøåÆøÅöôêÊ字符串Response>; 219 113 putWithFormUrlEncoded: (body: PutWithFormUrlEncodedData['body']) => Promise<void>; 220 114 }; 221 - 222 - export type NonAsciiÆøåÆøÅöôêÊServiceMethods = { 223 - nonAsciiæøåÆøÅöôêÊ字符串: (query: NonAsciiæøåÆøÅöôêÊ字符串Data['query']) => Promise<NonAsciiæøåÆøÅöôêÊ字符串Response>; 224 - putWithFormUrlEncoded: (body: PutWithFormUrlEncodedData['body']) => Promise<void>; 225 - };
-51
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/nestjs/default/nestjs.gen.ts
··· 52 52 nonAsciiæøåÆøÅöôêÊ字符串: (query: NonAsciiæøåÆøÅöôêÊ字符串Data['query']) => Promise<NonAsciiæøåÆøÅöôêÊ字符串Response>; 53 53 putWithFormUrlEncoded: (body: PutWithFormUrlEncodedData['body']) => Promise<void>; 54 54 }; 55 - 56 - export type ServiceMethods = { 57 - export: () => Promise<void>; 58 - patchApiVbyApiVersionNoTag: () => Promise<void>; 59 - import: (body: ImportData['body']) => Promise<ImportResponse>; 60 - fooWow: () => Promise<void>; 61 - apiVVersionODataControllerCount: () => Promise<ApiVVersionODataControllerCountResponse>; 62 - getApiVbyApiVersionSimpleOperation: (path: GetApiVbyApiVersionSimpleOperationData['path']) => Promise<GetApiVbyApiVersionSimpleOperationResponse>; 63 - deleteCallWithoutParametersAndResponse: () => Promise<void>; 64 - getCallWithoutParametersAndResponse: () => Promise<void>; 65 - headCallWithoutParametersAndResponse: () => Promise<void>; 66 - optionsCallWithoutParametersAndResponse: () => Promise<void>; 67 - patchCallWithoutParametersAndResponse: () => Promise<void>; 68 - postCallWithoutParametersAndResponse: () => Promise<void>; 69 - putCallWithoutParametersAndResponse: () => Promise<void>; 70 - deleteFoo: (path: DeleteFooData3['path'], headers: DeleteFooData3['headers']) => Promise<void>; 71 - callWithDescriptions: (query?: CallWithDescriptionsData['query']) => Promise<void>; 72 - deprecatedCall: (headers: DeprecatedCallData['headers']) => Promise<void>; 73 - callWithParameters: (path: CallWithParametersData['path'], query: CallWithParametersData['query'], body: CallWithParametersData['body'], headers: CallWithParametersData['headers']) => Promise<void>; 74 - callWithWeirdParameterNames: (path: CallWithWeirdParameterNamesData['path'], query: CallWithWeirdParameterNamesData['query'], body: CallWithWeirdParameterNamesData['body'], headers: CallWithWeirdParameterNamesData['headers']) => Promise<void>; 75 - getCallWithOptionalParam: (body: GetCallWithOptionalParamData['body'], query?: GetCallWithOptionalParamData['query']) => Promise<void>; 76 - postCallWithOptionalParam: (query: PostCallWithOptionalParamData['query'], body?: PostCallWithOptionalParamData['body']) => Promise<PostCallWithOptionalParamResponse>; 77 - postApiVbyApiVersionRequestBody: (query?: PostApiVbyApiVersionRequestBodyData['query'], body?: PostApiVbyApiVersionRequestBodyData['body']) => Promise<void>; 78 - postApiVbyApiVersionFormData: (query?: PostApiVbyApiVersionFormDataData['query'], body?: PostApiVbyApiVersionFormDataData['body']) => Promise<void>; 79 - callWithDefaultParameters: (query?: CallWithDefaultParametersData['query']) => Promise<void>; 80 - callWithDefaultOptionalParameters: (query?: CallWithDefaultOptionalParametersData['query']) => Promise<void>; 81 - callToTestOrderOfParams: (query: CallToTestOrderOfParamsData['query']) => Promise<void>; 82 - duplicateName: () => Promise<void>; 83 - duplicateName2: () => Promise<void>; 84 - duplicateName3: () => Promise<void>; 85 - duplicateName4: () => Promise<void>; 86 - callWithNoContentResponse: () => Promise<CallWithNoContentResponseResponse>; 87 - callWithResponseAndNoContentResponse: () => Promise<CallWithResponseAndNoContentResponseResponse>; 88 - dummyA: () => Promise<DummyAResponse>; 89 - dummyB: () => Promise<DummyBResponse>; 90 - callWithResponse: () => Promise<CallWithResponseResponse>; 91 - callWithDuplicateResponses: () => Promise<CallWithDuplicateResponsesResponse>; 92 - callWithResponses: () => Promise<CallWithResponsesResponse>; 93 - collectionFormat: (query: CollectionFormatData['query']) => Promise<void>; 94 - types: (query: TypesData['query'], path?: TypesData['path']) => Promise<TypesResponse>; 95 - uploadFile: (path: UploadFileData['path'], body: UploadFileData['body']) => Promise<UploadFileResponse>; 96 - fileResponse: (path: FileResponseData['path']) => Promise<FileResponseResponse>; 97 - complexTypes: (query: ComplexTypesData['query']) => Promise<ComplexTypesResponse>; 98 - multipartResponse: () => Promise<MultipartResponseResponse>; 99 - multipartRequest: (body?: MultipartRequestData['body']) => Promise<void>; 100 - complexParams: (path: ComplexParamsData['path'], body?: ComplexParamsData['body']) => Promise<ComplexParamsResponse>; 101 - callWithResultFromHeader: () => Promise<void>; 102 - testErrorCode: (query: TestErrorCodeData['query']) => Promise<void>; 103 - nonAsciiæøåÆøÅöôêÊ字符串: (query: NonAsciiæøåÆøÅöôêÊ字符串Data['query']) => Promise<NonAsciiæøåÆøÅöôêÊ字符串Response>; 104 - putWithFormUrlEncoded: (body: PutWithFormUrlEncodedData['body']) => Promise<void>; 105 - };
-111
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/nestjs/group-by-tag/nestjs.gen.ts
··· 10 10 getApiVbyApiVersionSimpleOperation: (path: GetApiVbyApiVersionSimpleOperationData['path']) => Promise<GetApiVbyApiVersionSimpleOperationResponse>; 11 11 }; 12 12 13 - export type DefaultServiceMethods = { 14 - export: () => Promise<void>; 15 - patchApiVbyApiVersionNoTag: () => Promise<void>; 16 - import: (body: ImportData['body']) => Promise<ImportResponse>; 17 - fooWow: () => Promise<void>; 18 - getApiVbyApiVersionSimpleOperation: (path: GetApiVbyApiVersionSimpleOperationData['path']) => Promise<GetApiVbyApiVersionSimpleOperationResponse>; 19 - }; 20 - 21 13 export type SimpleControllerMethods = { 22 14 apiVVersionODataControllerCount: () => Promise<ApiVVersionODataControllerCountResponse>; 23 15 deleteCallWithoutParametersAndResponse: () => Promise<void>; ··· 29 21 putCallWithoutParametersAndResponse: () => Promise<void>; 30 22 }; 31 23 32 - export type SimpleServiceMethods = { 33 - apiVVersionODataControllerCount: () => Promise<ApiVVersionODataControllerCountResponse>; 34 - deleteCallWithoutParametersAndResponse: () => Promise<void>; 35 - getCallWithoutParametersAndResponse: () => Promise<void>; 36 - headCallWithoutParametersAndResponse: () => Promise<void>; 37 - optionsCallWithoutParametersAndResponse: () => Promise<void>; 38 - patchCallWithoutParametersAndResponse: () => Promise<void>; 39 - postCallWithoutParametersAndResponse: () => Promise<void>; 40 - putCallWithoutParametersAndResponse: () => Promise<void>; 41 - }; 42 - 43 24 export type ParametersControllerMethods = { 44 25 deleteFoo: (path: DeleteFooData3['path'], headers: DeleteFooData3['headers']) => Promise<void>; 45 26 callWithParameters: (path: CallWithParametersData['path'], query: CallWithParametersData['query'], body: CallWithParametersData['body'], headers: CallWithParametersData['headers']) => Promise<void>; ··· 48 29 postCallWithOptionalParam: (query: PostCallWithOptionalParamData['query'], body?: PostCallWithOptionalParamData['body']) => Promise<PostCallWithOptionalParamResponse>; 49 30 }; 50 31 51 - export type ParametersServiceMethods = { 52 - deleteFoo: (path: DeleteFooData3['path'], headers: DeleteFooData3['headers']) => Promise<void>; 53 - callWithParameters: (path: CallWithParametersData['path'], query: CallWithParametersData['query'], body: CallWithParametersData['body'], headers: CallWithParametersData['headers']) => Promise<void>; 54 - callWithWeirdParameterNames: (path: CallWithWeirdParameterNamesData['path'], query: CallWithWeirdParameterNamesData['query'], body: CallWithWeirdParameterNamesData['body'], headers: CallWithWeirdParameterNamesData['headers']) => Promise<void>; 55 - getCallWithOptionalParam: (body: GetCallWithOptionalParamData['body'], query?: GetCallWithOptionalParamData['query']) => Promise<void>; 56 - postCallWithOptionalParam: (query: PostCallWithOptionalParamData['query'], body?: PostCallWithOptionalParamData['body']) => Promise<PostCallWithOptionalParamResponse>; 57 - }; 58 - 59 32 export type DescriptionsControllerMethods = { 60 33 callWithDescriptions: (query?: CallWithDescriptionsData['query']) => Promise<void>; 61 34 }; 62 35 63 - export type DescriptionsServiceMethods = { 64 - callWithDescriptions: (query?: CallWithDescriptionsData['query']) => Promise<void>; 65 - }; 66 - 67 36 export type DeprecatedControllerMethods = { 68 - deprecatedCall: (headers: DeprecatedCallData['headers']) => Promise<void>; 69 - }; 70 - 71 - export type DeprecatedServiceMethods = { 72 37 deprecatedCall: (headers: DeprecatedCallData['headers']) => Promise<void>; 73 38 }; 74 39 ··· 76 41 postApiVbyApiVersionRequestBody: (query?: PostApiVbyApiVersionRequestBodyData['query'], body?: PostApiVbyApiVersionRequestBodyData['body']) => Promise<void>; 77 42 }; 78 43 79 - export type RequestBodyServiceMethods = { 80 - postApiVbyApiVersionRequestBody: (query?: PostApiVbyApiVersionRequestBodyData['query'], body?: PostApiVbyApiVersionRequestBodyData['body']) => Promise<void>; 81 - }; 82 - 83 44 export type FormDataControllerMethods = { 84 45 postApiVbyApiVersionFormData: (query?: PostApiVbyApiVersionFormDataData['query'], body?: PostApiVbyApiVersionFormDataData['body']) => Promise<void>; 85 46 }; 86 47 87 - export type FormDataServiceMethods = { 88 - postApiVbyApiVersionFormData: (query?: PostApiVbyApiVersionFormDataData['query'], body?: PostApiVbyApiVersionFormDataData['body']) => Promise<void>; 89 - }; 90 - 91 48 export type DefaultsControllerMethods = { 92 - callWithDefaultParameters: (query?: CallWithDefaultParametersData['query']) => Promise<void>; 93 - callWithDefaultOptionalParameters: (query?: CallWithDefaultOptionalParametersData['query']) => Promise<void>; 94 - callToTestOrderOfParams: (query: CallToTestOrderOfParamsData['query']) => Promise<void>; 95 - }; 96 - 97 - export type DefaultsServiceMethods = { 98 49 callWithDefaultParameters: (query?: CallWithDefaultParametersData['query']) => Promise<void>; 99 50 callWithDefaultOptionalParameters: (query?: CallWithDefaultOptionalParametersData['query']) => Promise<void>; 100 51 callToTestOrderOfParams: (query: CallToTestOrderOfParamsData['query']) => Promise<void>; 101 52 }; 102 53 103 54 export type DuplicateControllerMethods = { 104 - duplicateName: () => Promise<void>; 105 - duplicateName2: () => Promise<void>; 106 - duplicateName3: () => Promise<void>; 107 - duplicateName4: () => Promise<void>; 108 - }; 109 - 110 - export type DuplicateServiceMethods = { 111 55 duplicateName: () => Promise<void>; 112 56 duplicateName2: () => Promise<void>; 113 57 duplicateName3: () => Promise<void>; ··· 118 62 callWithNoContentResponse: () => Promise<CallWithNoContentResponseResponse>; 119 63 }; 120 64 121 - export type NoContentServiceMethods = { 122 - callWithNoContentResponse: () => Promise<CallWithNoContentResponseResponse>; 123 - }; 124 - 125 65 export type ResponseControllerMethods = { 126 66 callWithResponseAndNoContentResponse: () => Promise<CallWithResponseAndNoContentResponseResponse>; 127 67 callWithResponse: () => Promise<CallWithResponseResponse>; ··· 129 69 callWithResponses: () => Promise<CallWithResponsesResponse>; 130 70 }; 131 71 132 - export type ResponseServiceMethods = { 133 - callWithResponseAndNoContentResponse: () => Promise<CallWithResponseAndNoContentResponseResponse>; 134 - callWithResponse: () => Promise<CallWithResponseResponse>; 135 - callWithDuplicateResponses: () => Promise<CallWithDuplicateResponsesResponse>; 136 - callWithResponses: () => Promise<CallWithResponsesResponse>; 137 - }; 138 - 139 72 export type MultipleTags1ControllerMethods = { 140 73 dummyA: () => Promise<DummyAResponse>; 141 74 dummyB: () => Promise<DummyBResponse>; 142 75 }; 143 76 144 - export type MultipleTags1ServiceMethods = { 145 - dummyA: () => Promise<DummyAResponse>; 146 - dummyB: () => Promise<DummyBResponse>; 147 - }; 148 - 149 77 export type CollectionFormatControllerMethods = { 150 78 collectionFormat: (query: CollectionFormatData['query']) => Promise<void>; 151 79 }; 152 80 153 - export type CollectionFormatServiceMethods = { 154 - collectionFormat: (query: CollectionFormatData['query']) => Promise<void>; 155 - }; 156 - 157 81 export type TypesControllerMethods = { 158 82 types: (query: TypesData['query'], path?: TypesData['path']) => Promise<TypesResponse>; 159 83 }; 160 84 161 - export type TypesServiceMethods = { 162 - types: (query: TypesData['query'], path?: TypesData['path']) => Promise<TypesResponse>; 163 - }; 164 - 165 85 export type UploadControllerMethods = { 166 - uploadFile: (path: UploadFileData['path'], body: UploadFileData['body']) => Promise<UploadFileResponse>; 167 - }; 168 - 169 - export type UploadServiceMethods = { 170 86 uploadFile: (path: UploadFileData['path'], body: UploadFileData['body']) => Promise<UploadFileResponse>; 171 87 }; 172 88 ··· 174 90 fileResponse: (path: FileResponseData['path']) => Promise<FileResponseResponse>; 175 91 }; 176 92 177 - export type FileResponseServiceMethods = { 178 - fileResponse: (path: FileResponseData['path']) => Promise<FileResponseResponse>; 179 - }; 180 - 181 93 export type ComplexControllerMethods = { 182 94 complexTypes: (query: ComplexTypesData['query']) => Promise<ComplexTypesResponse>; 183 95 complexParams: (path: ComplexParamsData['path'], body?: ComplexParamsData['body']) => Promise<ComplexParamsResponse>; 184 96 }; 185 97 186 - export type ComplexServiceMethods = { 187 - complexTypes: (query: ComplexTypesData['query']) => Promise<ComplexTypesResponse>; 188 - complexParams: (path: ComplexParamsData['path'], body?: ComplexParamsData['body']) => Promise<ComplexParamsResponse>; 189 - }; 190 - 191 98 export type MultipartControllerMethods = { 192 - multipartResponse: () => Promise<MultipartResponseResponse>; 193 - multipartRequest: (body?: MultipartRequestData['body']) => Promise<void>; 194 - }; 195 - 196 - export type MultipartServiceMethods = { 197 99 multipartResponse: () => Promise<MultipartResponseResponse>; 198 100 multipartRequest: (body?: MultipartRequestData['body']) => Promise<void>; 199 101 }; ··· 202 104 callWithResultFromHeader: () => Promise<void>; 203 105 }; 204 106 205 - export type HeaderServiceMethods = { 206 - callWithResultFromHeader: () => Promise<void>; 207 - }; 208 - 209 107 export type ErrorControllerMethods = { 210 108 testErrorCode: (query: TestErrorCodeData['query']) => Promise<void>; 211 109 }; 212 110 213 - export type ErrorServiceMethods = { 214 - testErrorCode: (query: TestErrorCodeData['query']) => Promise<void>; 215 - }; 216 - 217 111 export type NonAsciiÆøåÆøÅöôêÊControllerMethods = { 218 112 nonAsciiæøåÆøÅöôêÊ字符串: (query: NonAsciiæøåÆøÅöôêÊ字符串Data['query']) => Promise<NonAsciiæøåÆøÅöôêÊ字符串Response>; 219 113 putWithFormUrlEncoded: (body: PutWithFormUrlEncodedData['body']) => Promise<void>; 220 114 }; 221 - 222 - export type NonAsciiÆøåÆøÅöôêÊServiceMethods = { 223 - nonAsciiæøåÆøÅöôêÊ字符串: (query: NonAsciiæøåÆøÅöôêÊ字符串Data['query']) => Promise<NonAsciiæøåÆøÅöôêÊ字符串Response>; 224 - putWithFormUrlEncoded: (body: PutWithFormUrlEncodedData['body']) => Promise<void>; 225 - };
+1 -7
packages/openapi-ts/src/plugins/nestjs/plugin.ts
··· 140 140 plugin, 141 141 typeName: `${pascalTag}ControllerMethods`, 142 142 }); 143 - emitTypeAlias({ 144 - methods, 145 - plugin, 146 - typeName: `${pascalTag}ServiceMethods`, 147 - }); 148 143 } 149 144 } else { 150 - // Flat mode: single ControllerMethods + ServiceMethods 145 + // Flat mode: single ControllerMethods 151 146 const methods: Array<{ 152 147 name: string; 153 148 type: ReturnType<typeof $.type.func>; ··· 165 160 ); 166 161 167 162 emitTypeAlias({ methods, plugin, typeName: 'ControllerMethods' }); 168 - emitTypeAlias({ methods, plugin, typeName: 'ServiceMethods' }); 169 163 } 170 164 };