Skip to content

Commit 014cd2c

Browse files
authored
typescript-axios: withSeparateModelsAndApi - use import types properly. (#18625)
1 parent affb6bc commit 014cd2c

10 files changed

Lines changed: 20 additions & 20 deletions

File tree

modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import FormData from 'form-data'
1818
// @ts-ignore
1919
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '{{apiRelativeToRoot}}common';
2020
// @ts-ignore
21-
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '{{apiRelativeToRoot}}base';
21+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '{{apiRelativeToRoot}}base';
2222
{{#imports}}
2323
// @ts-ignore
24-
import { {{classname}} } from '{{apiRelativeToRoot}}{{tsModelPackage}}';
24+
import type { {{classname}} } from '{{apiRelativeToRoot}}{{tsModelPackage}}';
2525
{{/imports}}
2626
{{/withSeparateModelsAndApi}}
2727
{{^withSeparateModelsAndApi}}

modules/openapi-generator/src/main/resources/typescript-axios/model.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
{{#withSeparateModelsAndApi}}{{#hasAllOf}}{{#allOf}}
55
// May contain unused imports in some cases
66
// @ts-ignore
7-
import { {{class}} } from './{{filename}}';{{/allOf}}{{/hasAllOf}}{{#hasOneOf}}{{#oneOf}}
7+
import type { {{class}} } from './{{filename}}';{{/allOf}}{{/hasAllOf}}{{#hasOneOf}}{{#oneOf}}
88
// May contain unused imports in some cases
99
// @ts-ignore
10-
import { {{class}} } from './{{filename}}';{{/oneOf}}{{/hasOneOf}}{{^hasAllOf}}{{^hasOneOf}}{{#imports}}
10+
import type { {{class}} } from './{{filename}}';{{/oneOf}}{{/hasOneOf}}{{^hasAllOf}}{{^hasOneOf}}{{#imports}}
1111
// May contain unused imports in some cases
1212
// @ts-ignore
13-
import { {{class}} } from './{{filename}}';{{/imports}}{{/hasOneOf}}{{/hasAllOf}}{{/withSeparateModelsAndApi}}
13+
import type { {{class}} } from './{{filename}}';{{/imports}}{{/hasOneOf}}{{/hasAllOf}}{{/withSeparateModelsAndApi}}
1414
{{#models}}{{#model}}
1515
{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#allOf}}{{#-first}}{{>modelAllOf}}{{/-first}}{{/allOf}}{{^isEnum}}{{^oneOf}}{{^allOf}}{{>modelGeneric}}{{/allOf}}{{/oneOf}}{{/isEnum}}
1616
{{/model}}{{/models}}

samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/abstract-user-dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
// May contain unused imports in some cases
1717
// @ts-ignore
18-
import { BranchDto } from './branch-dto';
18+
import type { BranchDto } from './branch-dto';
1919

2020
/**
2121
*

samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/flat-stock-pick-order-dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
// May contain unused imports in some cases
1717
// @ts-ignore
18-
import { AbstractFlatStockPickOrderBaseDto } from './abstract-flat-stock-pick-order-base-dto';
18+
import type { AbstractFlatStockPickOrderBaseDto } from './abstract-flat-stock-pick-order-base-dto';
1919

2020
/**
2121
* @type FlatStockPickOrderDto

samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/internal-authenticated-user-dto.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616
// May contain unused imports in some cases
1717
// @ts-ignore
18-
import { AbstractUserDto } from './abstract-user-dto';
18+
import type { AbstractUserDto } from './abstract-user-dto';
1919
// May contain unused imports in some cases
2020
// @ts-ignore
21-
import { BranchDto } from './branch-dto';
21+
import type { BranchDto } from './branch-dto';
2222

2323
/**
2424
* @type InternalAuthenticatedUserDto

samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/remote-authenticated-user-dto.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616
// May contain unused imports in some cases
1717
// @ts-ignore
18-
import { AbstractUserDto } from './abstract-user-dto';
18+
import type { AbstractUserDto } from './abstract-user-dto';
1919
// May contain unused imports in some cases
2020
// @ts-ignore
21-
import { BranchDto } from './branch-dto';
21+
import type { BranchDto } from './branch-dto';
2222

2323
/**
2424
* @type RemoteAuthenticatedUserDto

samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import globalAxios from 'axios';
2020
// @ts-ignore
2121
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../../../common';
2222
// @ts-ignore
23-
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../../base';
23+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../../base';
2424
// @ts-ignore
25-
import { ApiResponse } from '../../../model/some/levels/deep';
25+
import type { ApiResponse } from '../../../model/some/levels/deep';
2626
// @ts-ignore
27-
import { Pet } from '../../../model/some/levels/deep';
27+
import type { Pet } from '../../../model/some/levels/deep';
2828
/**
2929
* PetApi - axios parameter creator
3030
* @export

samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import globalAxios from 'axios';
2020
// @ts-ignore
2121
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../../../common';
2222
// @ts-ignore
23-
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../../base';
23+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../../base';
2424
// @ts-ignore
25-
import { Order } from '../../../model/some/levels/deep';
25+
import type { Order } from '../../../model/some/levels/deep';
2626
/**
2727
* StoreApi - axios parameter creator
2828
* @export

samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import globalAxios from 'axios';
2020
// @ts-ignore
2121
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../../../common';
2222
// @ts-ignore
23-
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../../base';
23+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../../base';
2424
// @ts-ignore
25-
import { User } from '../../../model/some/levels/deep';
25+
import type { User } from '../../../model/some/levels/deep';
2626
/**
2727
* UserApi - axios parameter creator
2828
* @export

samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616
// May contain unused imports in some cases
1717
// @ts-ignore
18-
import { Category } from './category';
18+
import type { Category } from './category';
1919
// May contain unused imports in some cases
2020
// @ts-ignore
21-
import { Tag } from './tag';
21+
import type { Tag } from './tag';
2222

2323
/**
2424
* A pet for sale in the pet store

0 commit comments

Comments
 (0)