From a159e7724519a67fd9225e4e8e74680fe61fe44c Mon Sep 17 00:00:00 2001 From: Ferdi Koomen Date: Wed, 26 Jan 2022 10:25:08 +0100 Subject: [PATCH] - Fixed issue #940 --- src/templates/index.hbs | 2 +- src/utils/writeClientIndex.ts | 1 + test/index.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/templates/index.hbs b/src/templates/index.hbs index 3c58e1cfc..855d0c63a 100644 --- a/src/templates/index.hbs +++ b/src/templates/index.hbs @@ -1,7 +1,7 @@ {{>header}} {{#if @root.exportClient}} -export { AppClient } from './client'; +export { {{{clientName}}} } from './client'; {{/if}} {{#if @root.exportCore}} export { ApiError } from './core/ApiError'; diff --git a/src/utils/writeClientIndex.ts b/src/utils/writeClientIndex.ts index 67ef0ced0..eaecd1b40 100644 --- a/src/utils/writeClientIndex.ts +++ b/src/utils/writeClientIndex.ts @@ -41,6 +41,7 @@ export const writeClientIndex = async ( exportSchemas, useUnionTypes, postfix, + clientName, server: client.server, version: client.version, models: sortModelsByName(client.models), diff --git a/test/index.js b/test/index.js index 9ed5fd85f..2d4bc491c 100644 --- a/test/index.js +++ b/test/index.js @@ -14,7 +14,7 @@ const generate = async (input, output) => { exportSchemas: true, exportModels: true, exportServices: true, - // clientName: 'AppClient', + // clientName: 'DemoAppClient', // indent: OpenAPI.Indent.SPACE_2, // postfix: 'Api', // request: './test/custom/request.ts',