|  | 
| 1 | 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP | 
| 2 | 2 | 
 | 
|  | 3 | +exports[`v2 should generate: ./test/generated/v2/client.ts 1`] = ` | 
|  | 4 | +"/* istanbul ignore file */ | 
|  | 5 | +/* tslint:disable */ | 
|  | 6 | +/* eslint-disable */ | 
|  | 7 | +import type { BaseHttpRequest } from './core/BaseHttpRequest'; | 
|  | 8 | +import type { OpenAPIConfig } from './core/OpenAPI'; | 
|  | 9 | +import { FetchHttpRequest } from './core/FetchHttpRequest'; | 
|  | 10 | + | 
|  | 11 | +import { CollectionFormatService } from './services/CollectionFormatService'; | 
|  | 12 | +import { ComplexService } from './services/ComplexService'; | 
|  | 13 | +import { DefaultService } from './services/DefaultService'; | 
|  | 14 | +import { DefaultsService } from './services/DefaultsService'; | 
|  | 15 | +import { DescriptionsService } from './services/DescriptionsService'; | 
|  | 16 | +import { DuplicateService } from './services/DuplicateService'; | 
|  | 17 | +import { ErrorService } from './services/ErrorService'; | 
|  | 18 | +import { HeaderService } from './services/HeaderService'; | 
|  | 19 | +import { MultipleTags1Service } from './services/MultipleTags1Service'; | 
|  | 20 | +import { MultipleTags2Service } from './services/MultipleTags2Service'; | 
|  | 21 | +import { MultipleTags3Service } from './services/MultipleTags3Service'; | 
|  | 22 | +import { NoContentService } from './services/NoContentService'; | 
|  | 23 | +import { ParametersService } from './services/ParametersService'; | 
|  | 24 | +import { ResponseService } from './services/ResponseService'; | 
|  | 25 | +import { SimpleService } from './services/SimpleService'; | 
|  | 26 | +import { TypesService } from './services/TypesService'; | 
|  | 27 | + | 
|  | 28 | +type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest; | 
|  | 29 | + | 
|  | 30 | +export class DemoAppClient { | 
|  | 31 | + | 
|  | 32 | + public readonly collectionFormat: CollectionFormatService; | 
|  | 33 | + public readonly complex: ComplexService; | 
|  | 34 | + public readonly default: DefaultService; | 
|  | 35 | + public readonly defaults: DefaultsService; | 
|  | 36 | + public readonly descriptions: DescriptionsService; | 
|  | 37 | + public readonly duplicate: DuplicateService; | 
|  | 38 | + public readonly error: ErrorService; | 
|  | 39 | + public readonly header: HeaderService; | 
|  | 40 | + public readonly multipleTags1: MultipleTags1Service; | 
|  | 41 | + public readonly multipleTags2: MultipleTags2Service; | 
|  | 42 | + public readonly multipleTags3: MultipleTags3Service; | 
|  | 43 | + public readonly noContent: NoContentService; | 
|  | 44 | + public readonly parameters: ParametersService; | 
|  | 45 | + public readonly response: ResponseService; | 
|  | 46 | + public readonly simple: SimpleService; | 
|  | 47 | + public readonly types: TypesService; | 
|  | 48 | + | 
|  | 49 | + public readonly request: BaseHttpRequest; | 
|  | 50 | + | 
|  | 51 | + constructor(config?: Partial<OpenAPIConfig>, HttpRequest: HttpRequestConstructor = FetchHttpRequest) { | 
|  | 52 | + this.request = new HttpRequest({ | 
|  | 53 | + BASE: config?.BASE ?? 'http://localhost:3000/base', | 
|  | 54 | + VERSION: config?.VERSION ?? '1.0', | 
|  | 55 | + WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false, | 
|  | 56 | + CREDENTIALS: config?.CREDENTIALS ?? 'include', | 
|  | 57 | + TOKEN: config?.TOKEN, | 
|  | 58 | + USERNAME: config?.USERNAME, | 
|  | 59 | + PASSWORD: config?.PASSWORD, | 
|  | 60 | + HEADERS: config?.HEADERS, | 
|  | 61 | + ENCODE_PATH: config?.ENCODE_PATH, | 
|  | 62 | + }); | 
|  | 63 | + | 
|  | 64 | + this.collectionFormat = new CollectionFormatService(this.request); | 
|  | 65 | + this.complex = new ComplexService(this.request); | 
|  | 66 | + this.default = new DefaultService(this.request); | 
|  | 67 | + this.defaults = new DefaultsService(this.request); | 
|  | 68 | + this.descriptions = new DescriptionsService(this.request); | 
|  | 69 | + this.duplicate = new DuplicateService(this.request); | 
|  | 70 | + this.error = new ErrorService(this.request); | 
|  | 71 | + this.header = new HeaderService(this.request); | 
|  | 72 | + this.multipleTags1 = new MultipleTags1Service(this.request); | 
|  | 73 | + this.multipleTags2 = new MultipleTags2Service(this.request); | 
|  | 74 | + this.multipleTags3 = new MultipleTags3Service(this.request); | 
|  | 75 | + this.noContent = new NoContentService(this.request); | 
|  | 76 | + this.parameters = new ParametersService(this.request); | 
|  | 77 | + this.response = new ResponseService(this.request); | 
|  | 78 | + this.simple = new SimpleService(this.request); | 
|  | 79 | + this.types = new TypesService(this.request); | 
|  | 80 | + } | 
|  | 81 | +}" | 
|  | 82 | +`; | 
|  | 83 | + | 
| 3 | 84 | exports[`v2 should generate: ./test/generated/v2/core/ApiError.ts 1`] = ` | 
| 4 | 85 | "/* istanbul ignore file */ | 
| 5 | 86 | /* tslint:disable */ | 
| @@ -639,6 +720,7 @@ export { CollectionFormatService } from './services/CollectionFormatService'; | 
| 639 | 720 | export { ComplexService } from './services/ComplexService'; | 
| 640 | 721 | export { DefaultService } from './services/DefaultService'; | 
| 641 | 722 | export { DefaultsService } from './services/DefaultsService'; | 
|  | 723 | +export { DescriptionsService } from './services/DescriptionsService'; | 
| 642 | 724 | export { DuplicateService } from './services/DuplicateService'; | 
| 643 | 725 | export { ErrorService } from './services/ErrorService'; | 
| 644 | 726 | export { HeaderService } from './services/HeaderService'; | 
| @@ -2369,6 +2451,53 @@ export class DefaultsService { | 
| 2369 | 2451 | }" | 
| 2370 | 2452 | `; | 
| 2371 | 2453 | 
 | 
|  | 2454 | +exports[`v2 should generate: ./test/generated/v2/services/DescriptionsService.ts 1`] = ` | 
|  | 2455 | +"/* istanbul ignore file */ | 
|  | 2456 | +/* tslint:disable */ | 
|  | 2457 | +/* eslint-disable */ | 
|  | 2458 | +import type { CancelablePromise } from '../core/CancelablePromise'; | 
|  | 2459 | +import { OpenAPI } from '../core/OpenAPI'; | 
|  | 2460 | +import { request as __request } from '../core/request'; | 
|  | 2461 | + | 
|  | 2462 | +export class DescriptionsService { | 
|  | 2463 | + | 
|  | 2464 | + /** | 
|  | 2465 | + * @param parameterWithBreaks Testing multiline comments in string: First line | 
|  | 2466 | + * Second line | 
|  | 2467 | + * | 
|  | 2468 | + * Fourth line | 
|  | 2469 | + * @param parameterWithBackticks Testing backticks in string: \`backticks\` and \`\`\`multiple backticks\`\`\` should work | 
|  | 2470 | + * @param parameterWithSlashes Testing slashes in string: \\\\backwards\\\\\\\\\\\\ and /forwards/// should work | 
|  | 2471 | + * @param parameterWithExpressionPlaceholders Testing expression placeholders in string: \${expression} should work | 
|  | 2472 | + * @param parameterWithQuotes Testing quotes in string: 'single quote''' and \\"double quotes\\"\\"\\" should work | 
|  | 2473 | + * @param parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work | 
|  | 2474 | + * @throws ApiError | 
|  | 2475 | + */ | 
|  | 2476 | + public static callWithDescriptions( | 
|  | 2477 | + parameterWithBreaks?: string, | 
|  | 2478 | + parameterWithBackticks?: string, | 
|  | 2479 | + parameterWithSlashes?: string, | 
|  | 2480 | + parameterWithExpressionPlaceholders?: string, | 
|  | 2481 | + parameterWithQuotes?: string, | 
|  | 2482 | + parameterWithReservedCharacters?: string, | 
|  | 2483 | + ): CancelablePromise<void> { | 
|  | 2484 | + return __request(OpenAPI, { | 
|  | 2485 | + method: 'POST', | 
|  | 2486 | + url: '/api/v{api-version}/descriptions/', | 
|  | 2487 | + query: { | 
|  | 2488 | + 'parameterWithBreaks': parameterWithBreaks, | 
|  | 2489 | + 'parameterWithBackticks': parameterWithBackticks, | 
|  | 2490 | + 'parameterWithSlashes': parameterWithSlashes, | 
|  | 2491 | + 'parameterWithExpressionPlaceholders': parameterWithExpressionPlaceholders, | 
|  | 2492 | + 'parameterWithQuotes': parameterWithQuotes, | 
|  | 2493 | + 'parameterWithReservedCharacters': parameterWithReservedCharacters, | 
|  | 2494 | + }, | 
|  | 2495 | + }); | 
|  | 2496 | + } | 
|  | 2497 | + | 
|  | 2498 | +}" | 
|  | 2499 | +`; | 
|  | 2500 | + | 
| 2372 | 2501 | exports[`v2 should generate: ./test/generated/v2/services/DuplicateService.ts 1`] = ` | 
| 2373 | 2502 | "/* istanbul ignore file */ | 
| 2374 | 2503 | /* tslint:disable */ | 
| @@ -2901,6 +3030,99 @@ export class TypesService { | 
| 2901 | 3030 | }" | 
| 2902 | 3031 | `; | 
| 2903 | 3032 | 
 | 
|  | 3033 | +exports[`v3 should generate: ./test/generated/v3/client.ts 1`] = ` | 
|  | 3034 | +"/* istanbul ignore file */ | 
|  | 3035 | +/* tslint:disable */ | 
|  | 3036 | +/* eslint-disable */ | 
|  | 3037 | +import type { BaseHttpRequest } from './core/BaseHttpRequest'; | 
|  | 3038 | +import type { OpenAPIConfig } from './core/OpenAPI'; | 
|  | 3039 | +import { FetchHttpRequest } from './core/FetchHttpRequest'; | 
|  | 3040 | + | 
|  | 3041 | +import { CollectionFormatService } from './services/CollectionFormatService'; | 
|  | 3042 | +import { ComplexService } from './services/ComplexService'; | 
|  | 3043 | +import { DefaultService } from './services/DefaultService'; | 
|  | 3044 | +import { DefaultsService } from './services/DefaultsService'; | 
|  | 3045 | +import { DescriptionsService } from './services/DescriptionsService'; | 
|  | 3046 | +import { DuplicateService } from './services/DuplicateService'; | 
|  | 3047 | +import { ErrorService } from './services/ErrorService'; | 
|  | 3048 | +import { FormDataService } from './services/FormDataService'; | 
|  | 3049 | +import { HeaderService } from './services/HeaderService'; | 
|  | 3050 | +import { MultipartService } from './services/MultipartService'; | 
|  | 3051 | +import { MultipleTags1Service } from './services/MultipleTags1Service'; | 
|  | 3052 | +import { MultipleTags2Service } from './services/MultipleTags2Service'; | 
|  | 3053 | +import { MultipleTags3Service } from './services/MultipleTags3Service'; | 
|  | 3054 | +import { NoContentService } from './services/NoContentService'; | 
|  | 3055 | +import { ParametersService } from './services/ParametersService'; | 
|  | 3056 | +import { RequestBodyService } from './services/RequestBodyService'; | 
|  | 3057 | +import { ResponseService } from './services/ResponseService'; | 
|  | 3058 | +import { SimpleService } from './services/SimpleService'; | 
|  | 3059 | +import { TypesService } from './services/TypesService'; | 
|  | 3060 | +import { UploadService } from './services/UploadService'; | 
|  | 3061 | + | 
|  | 3062 | +type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest; | 
|  | 3063 | + | 
|  | 3064 | +export class DemoAppClient { | 
|  | 3065 | + | 
|  | 3066 | + public readonly collectionFormat: CollectionFormatService; | 
|  | 3067 | + public readonly complex: ComplexService; | 
|  | 3068 | + public readonly default: DefaultService; | 
|  | 3069 | + public readonly defaults: DefaultsService; | 
|  | 3070 | + public readonly descriptions: DescriptionsService; | 
|  | 3071 | + public readonly duplicate: DuplicateService; | 
|  | 3072 | + public readonly error: ErrorService; | 
|  | 3073 | + public readonly formData: FormDataService; | 
|  | 3074 | + public readonly header: HeaderService; | 
|  | 3075 | + public readonly multipart: MultipartService; | 
|  | 3076 | + public readonly multipleTags1: MultipleTags1Service; | 
|  | 3077 | + public readonly multipleTags2: MultipleTags2Service; | 
|  | 3078 | + public readonly multipleTags3: MultipleTags3Service; | 
|  | 3079 | + public readonly noContent: NoContentService; | 
|  | 3080 | + public readonly parameters: ParametersService; | 
|  | 3081 | + public readonly requestBody: RequestBodyService; | 
|  | 3082 | + public readonly response: ResponseService; | 
|  | 3083 | + public readonly simple: SimpleService; | 
|  | 3084 | + public readonly types: TypesService; | 
|  | 3085 | + public readonly upload: UploadService; | 
|  | 3086 | + | 
|  | 3087 | + public readonly request: BaseHttpRequest; | 
|  | 3088 | + | 
|  | 3089 | + constructor(config?: Partial<OpenAPIConfig>, HttpRequest: HttpRequestConstructor = FetchHttpRequest) { | 
|  | 3090 | + this.request = new HttpRequest({ | 
|  | 3091 | + BASE: config?.BASE ?? 'http://localhost:3000/base', | 
|  | 3092 | + VERSION: config?.VERSION ?? '1.0', | 
|  | 3093 | + WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false, | 
|  | 3094 | + CREDENTIALS: config?.CREDENTIALS ?? 'include', | 
|  | 3095 | + TOKEN: config?.TOKEN, | 
|  | 3096 | + USERNAME: config?.USERNAME, | 
|  | 3097 | + PASSWORD: config?.PASSWORD, | 
|  | 3098 | + HEADERS: config?.HEADERS, | 
|  | 3099 | + ENCODE_PATH: config?.ENCODE_PATH, | 
|  | 3100 | + }); | 
|  | 3101 | + | 
|  | 3102 | + this.collectionFormat = new CollectionFormatService(this.request); | 
|  | 3103 | + this.complex = new ComplexService(this.request); | 
|  | 3104 | + this.default = new DefaultService(this.request); | 
|  | 3105 | + this.defaults = new DefaultsService(this.request); | 
|  | 3106 | + this.descriptions = new DescriptionsService(this.request); | 
|  | 3107 | + this.duplicate = new DuplicateService(this.request); | 
|  | 3108 | + this.error = new ErrorService(this.request); | 
|  | 3109 | + this.formData = new FormDataService(this.request); | 
|  | 3110 | + this.header = new HeaderService(this.request); | 
|  | 3111 | + this.multipart = new MultipartService(this.request); | 
|  | 3112 | + this.multipleTags1 = new MultipleTags1Service(this.request); | 
|  | 3113 | + this.multipleTags2 = new MultipleTags2Service(this.request); | 
|  | 3114 | + this.multipleTags3 = new MultipleTags3Service(this.request); | 
|  | 3115 | + this.noContent = new NoContentService(this.request); | 
|  | 3116 | + this.parameters = new ParametersService(this.request); | 
|  | 3117 | + this.requestBody = new RequestBodyService(this.request); | 
|  | 3118 | + this.response = new ResponseService(this.request); | 
|  | 3119 | + this.simple = new SimpleService(this.request); | 
|  | 3120 | + this.types = new TypesService(this.request); | 
|  | 3121 | + this.upload = new UploadService(this.request); | 
|  | 3122 | + } | 
|  | 3123 | +}" | 
|  | 3124 | +`; | 
|  | 3125 | + | 
| 2904 | 3126 | exports[`v3 should generate: ./test/generated/v3/core/ApiError.ts 1`] = ` | 
| 2905 | 3127 | "/* istanbul ignore file */ | 
| 2906 | 3128 | /* tslint:disable */ | 
| @@ -3564,6 +3786,7 @@ export { CollectionFormatService } from './services/CollectionFormatService'; | 
| 3564 | 3786 | export { ComplexService } from './services/ComplexService'; | 
| 3565 | 3787 | export { DefaultService } from './services/DefaultService'; | 
| 3566 | 3788 | export { DefaultsService } from './services/DefaultsService'; | 
|  | 3789 | +export { DescriptionsService } from './services/DescriptionsService'; | 
| 3567 | 3790 | export { DuplicateService } from './services/DuplicateService'; | 
| 3568 | 3791 | export { ErrorService } from './services/ErrorService'; | 
| 3569 | 3792 | export { FormDataService } from './services/FormDataService'; | 
| @@ -5883,6 +6106,53 @@ export class DefaultsService { | 
| 5883 | 6106 | }" | 
| 5884 | 6107 | `; | 
| 5885 | 6108 | 
 | 
|  | 6109 | +exports[`v3 should generate: ./test/generated/v3/services/DescriptionsService.ts 1`] = ` | 
|  | 6110 | +"/* istanbul ignore file */ | 
|  | 6111 | +/* tslint:disable */ | 
|  | 6112 | +/* eslint-disable */ | 
|  | 6113 | +import type { CancelablePromise } from '../core/CancelablePromise'; | 
|  | 6114 | +import { OpenAPI } from '../core/OpenAPI'; | 
|  | 6115 | +import { request as __request } from '../core/request'; | 
|  | 6116 | + | 
|  | 6117 | +export class DescriptionsService { | 
|  | 6118 | + | 
|  | 6119 | + /** | 
|  | 6120 | + * @param parameterWithBreaks Testing multiline comments in string: First line | 
|  | 6121 | + * Second line | 
|  | 6122 | + * | 
|  | 6123 | + * Fourth line | 
|  | 6124 | + * @param parameterWithBackticks Testing backticks in string: \`backticks\` and \`\`\`multiple backticks\`\`\` should work | 
|  | 6125 | + * @param parameterWithSlashes Testing slashes in string: \\\\backwards\\\\\\\\\\\\ and /forwards/// should work | 
|  | 6126 | + * @param parameterWithExpressionPlaceholders Testing expression placeholders in string: \${expression} should work | 
|  | 6127 | + * @param parameterWithQuotes Testing quotes in string: 'single quote''' and \\"double quotes\\"\\"\\" should work | 
|  | 6128 | + * @param parameterWithReservedCharacters Testing reserved characters in string: * inline * and ** inline ** should work | 
|  | 6129 | + * @throws ApiError | 
|  | 6130 | + */ | 
|  | 6131 | + public static callWithDescriptions( | 
|  | 6132 | + parameterWithBreaks?: any, | 
|  | 6133 | + parameterWithBackticks?: any, | 
|  | 6134 | + parameterWithSlashes?: any, | 
|  | 6135 | + parameterWithExpressionPlaceholders?: any, | 
|  | 6136 | + parameterWithQuotes?: any, | 
|  | 6137 | + parameterWithReservedCharacters?: any, | 
|  | 6138 | + ): CancelablePromise<void> { | 
|  | 6139 | + return __request(OpenAPI, { | 
|  | 6140 | + method: 'POST', | 
|  | 6141 | + url: '/api/v{api-version}/descriptions/', | 
|  | 6142 | + query: { | 
|  | 6143 | + 'parameterWithBreaks': parameterWithBreaks, | 
|  | 6144 | + 'parameterWithBackticks': parameterWithBackticks, | 
|  | 6145 | + 'parameterWithSlashes': parameterWithSlashes, | 
|  | 6146 | + 'parameterWithExpressionPlaceholders': parameterWithExpressionPlaceholders, | 
|  | 6147 | + 'parameterWithQuotes': parameterWithQuotes, | 
|  | 6148 | + 'parameterWithReservedCharacters': parameterWithReservedCharacters, | 
|  | 6149 | + }, | 
|  | 6150 | + }); | 
|  | 6151 | + } | 
|  | 6152 | + | 
|  | 6153 | +}" | 
|  | 6154 | +`; | 
|  | 6155 | + | 
| 5886 | 6156 | exports[`v3 should generate: ./test/generated/v3/services/DuplicateService.ts 1`] = ` | 
| 5887 | 6157 | "/* istanbul ignore file */ | 
| 5888 | 6158 | /* tslint:disable */ | 
|  | 
0 commit comments