|
1 |
| -import { resolve } from 'path'; |
| 1 | +import {resolve} from 'path'; |
2 | 2 |
|
3 |
| -import type { Client } from '../client/interfaces/Client'; |
4 |
| -import { HttpClient } from '../HttpClient'; |
5 |
| -import type { Indent } from '../Indent'; |
6 |
| -import { copyFile, exists, writeFile } from './fileSystem'; |
7 |
| -import { formatIndentation as i } from './formatIndentation'; |
8 |
| -import { getHttpRequestName } from './getHttpRequestName'; |
9 |
| -import { isDefined } from './isDefined'; |
10 |
| -import type { Templates } from './registerHandlebarTemplates'; |
| 3 | +import type {Client} from '../client/interfaces/Client'; |
| 4 | +import {HttpClient} from '../HttpClient'; |
| 5 | +import type {Indent} from '../Indent'; |
| 6 | +import {copyFile, exists, writeFile} from './fileSystem'; |
| 7 | +import {formatIndentation as i} from './formatIndentation'; |
| 8 | +import {getHttpRequestName} from './getHttpRequestName'; |
| 9 | +import {isDefined} from './isDefined'; |
| 10 | +import type {Templates} from './registerHandlebarTemplates'; |
11 | 11 |
|
12 | 12 | /**
|
13 | 13 | * Generate OpenAPI core files, this includes the basic boilerplate code to handle requests.
|
@@ -38,11 +38,13 @@ export const writeClientCore = async (
|
38 | 38 | services: client.services,
|
39 | 39 | };
|
40 | 40 |
|
41 |
| - await writeFile(resolve(outputPath, 'OpenAPI.ts'), i(templates.core.settings(context), indent)); |
42 |
| - await writeFile(resolve(outputPath, 'ApiError.ts'), i(templates.core.apiError(context), indent)); |
43 |
| - await writeFile(resolve(outputPath, 'ApiRequestOptions.ts'), i(templates.core.apiRequestOptions(context), indent)); |
44 |
| - await writeFile(resolve(outputPath, 'ApiResult.ts'), i(templates.core.apiResult(context), indent)); |
45 |
| - await writeFile(resolve(outputPath, 'CancelablePromise.ts'), i(templates.core.cancelablePromise(context), indent)); |
| 41 | + if (httpClient !== HttpClient.MAPPERSMITH) { |
| 42 | + await writeFile(resolve(outputPath, 'OpenAPI.ts'), i(templates.core.settings(context), indent)); |
| 43 | + await writeFile(resolve(outputPath, 'ApiError.ts'), i(templates.core.apiError(context), indent)); |
| 44 | + await writeFile(resolve(outputPath, 'ApiRequestOptions.ts'), i(templates.core.apiRequestOptions(context), indent)); |
| 45 | + await writeFile(resolve(outputPath, 'ApiResult.ts'), i(templates.core.apiResult(context), indent)); |
| 46 | + await writeFile(resolve(outputPath, 'CancelablePromise.ts'), i(templates.core.cancelablePromise(context), indent)); |
| 47 | + } |
46 | 48 | await writeFile(resolve(outputPath, 'request.ts'), i(templates.core.request(context), indent));
|
47 | 49 |
|
48 | 50 | if (isDefined(clientName) && httpClient !== HttpClient.MAPPERSMITH) {
|
|
0 commit comments