[typescript-fetch] fix circular imports being generated (#10798)

templates based off of #6140 and @ajaska

closes #6140
This commit is contained in:
Jens L 2021-11-22 22:17:15 +01:00 committed by GitHub
parent e9f2ccde67
commit 49e9911b3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 81 additions and 38 deletions

View File

@ -1,13 +1,13 @@
import { exists, mapValues } from '../runtime';
{{#hasImports}}
import {
{{#imports}}
import {
{{{.}}},
{{.}}FromJSON,
{{.}}FromJSONTyped,
{{.}}ToJSON,
} from './{{.}}';
{{/imports}}
} from './';
{{/hasImports}}
{{#discriminator}}

View File

@ -1,13 +1,12 @@
{{#hasImports}}
import {
{{#imports}}
{{{.}}},
{{/imports}}
{{#oneOf}}
import {
{{{.}}},
{{{.}}}FromJSON,
{{{.}}}FromJSONTyped,
{{{.}}}ToJSON,
} from './{{.}}';
{{/oneOf}}
} from './';
{{/hasImports}}
{{>modelOneOfInterfaces}}

View File

@ -18,7 +18,7 @@ import {
ReadOnlyFirstFromJSON,
ReadOnlyFirstFromJSONTyped,
ReadOnlyFirstToJSON,
} from './';
} from './ReadOnlyFirst';
/**
*

View File

@ -18,11 +18,13 @@ import {
AnimalFromJSON,
AnimalFromJSONTyped,
AnimalToJSON,
} from './Animal';
import {
CatAllOf,
CatAllOfFromJSON,
CatAllOfFromJSONTyped,
CatAllOfToJSON,
} from './';
} from './CatAllOf';
/**
*

View File

@ -18,11 +18,13 @@ import {
AnimalFromJSON,
AnimalFromJSONTyped,
AnimalToJSON,
} from './Animal';
import {
DogAllOf,
DogAllOfFromJSON,
DogAllOfFromJSONTyped,
DogAllOfToJSON,
} from './';
} from './DogAllOf';
/**
*

View File

@ -18,19 +18,25 @@ import {
OuterEnumFromJSON,
OuterEnumFromJSONTyped,
OuterEnumToJSON,
} from './OuterEnum';
import {
OuterEnumDefaultValue,
OuterEnumDefaultValueFromJSON,
OuterEnumDefaultValueFromJSONTyped,
OuterEnumDefaultValueToJSON,
} from './OuterEnumDefaultValue';
import {
OuterEnumInteger,
OuterEnumIntegerFromJSON,
OuterEnumIntegerFromJSONTyped,
OuterEnumIntegerToJSON,
} from './OuterEnumInteger';
import {
OuterEnumIntegerDefaultValue,
OuterEnumIntegerDefaultValueFromJSON,
OuterEnumIntegerDefaultValueFromJSONTyped,
OuterEnumIntegerDefaultValueToJSON,
} from './';
} from './OuterEnumIntegerDefaultValue';
/**
*

View File

@ -18,7 +18,7 @@ import {
DecimalFromJSON,
DecimalFromJSONTyped,
DecimalToJSON,
} from './';
} from './Decimal';
/**
*

View File

@ -18,7 +18,7 @@ import {
FooFromJSON,
FooFromJSONTyped,
FooToJSON,
} from './';
} from './Foo';
/**
*

View File

@ -18,7 +18,7 @@ import {
AnimalFromJSON,
AnimalFromJSONTyped,
AnimalToJSON,
} from './';
} from './Animal';
/**
*

View File

@ -18,7 +18,7 @@ import {
DeprecatedObjectFromJSON,
DeprecatedObjectFromJSONTyped,
DeprecatedObjectToJSON,
} from './';
} from './DeprecatedObject';
/**
*

View File

@ -18,7 +18,7 @@ import {
OuterEnumIntegerFromJSON,
OuterEnumIntegerFromJSONTyped,
OuterEnumIntegerToJSON,
} from './';
} from './OuterEnumInteger';
/**
*

View File

@ -18,11 +18,13 @@ import {
CategoryFromJSON,
CategoryFromJSONTyped,
CategoryToJSON,
} from './Category';
import {
Tag,
TagFromJSON,
TagFromJSONTyped,
TagToJSON,
} from './';
} from './Tag';
/**
*

View File

@ -18,11 +18,13 @@ import {
CategoryFromJSON,
CategoryFromJSONTyped,
CategoryToJSON,
} from './Category';
import {
Tag,
TagFromJSON,
TagFromJSONTyped,
TagToJSON,
} from './';
} from './Tag';
/**
* A pet for sale in the pet store

View File

@ -18,11 +18,13 @@ import {
NumberEnumFromJSON,
NumberEnumFromJSONTyped,
NumberEnumToJSON,
} from './NumberEnum';
import {
StringEnum,
StringEnumFromJSON,
StringEnumFromJSONTyped,
StringEnumToJSON,
} from './';
} from './StringEnum';
/**
*

View File

@ -18,11 +18,13 @@ import {
CategoryFromJSON,
CategoryFromJSONTyped,
CategoryToJSON,
} from './Category';
import {
Tag,
TagFromJSON,
TagFromJSONTyped,
TagToJSON,
} from './';
} from './Tag';
/**
* A pet for sale in the pet store

View File

@ -18,11 +18,13 @@ import {
CategoryFromJSON,
CategoryFromJSONTyped,
CategoryToJSON,
} from './Category';
import {
Tag,
TagFromJSON,
TagFromJSONTyped,
TagToJSON,
} from './';
} from './Tag';
/**
* A pet for sale in the pet store

View File

@ -18,11 +18,13 @@ import {
CategoryFromJSON,
CategoryFromJSONTyped,
CategoryToJSON,
} from './Category';
import {
Tag,
TagFromJSON,
TagFromJSONTyped,
TagToJSON,
} from './';
} from './Tag';
/**
* A pet for sale in the pet store

View File

@ -18,7 +18,7 @@ import {
ResponseMetaFromJSON,
ResponseMetaFromJSONTyped,
ResponseMetaToJSON,
} from './';
} from './ResponseMeta';
/**
*

View File

@ -18,11 +18,13 @@ import {
PetFromJSON,
PetFromJSONTyped,
PetToJSON,
} from './Pet';
import {
ResponseMeta,
ResponseMetaFromJSON,
ResponseMetaFromJSONTyped,
ResponseMetaToJSON,
} from './';
} from './ResponseMeta';
/**
*

View File

@ -18,11 +18,13 @@ import {
ResponseMetaFromJSON,
ResponseMetaFromJSONTyped,
ResponseMetaToJSON,
} from './ResponseMeta';
import {
User,
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
} from './';
} from './User';
/**
*

View File

@ -18,7 +18,7 @@ import {
ResponseMetaFromJSON,
ResponseMetaFromJSONTyped,
ResponseMetaToJSON,
} from './';
} from './ResponseMeta';
/**
*

View File

@ -18,11 +18,13 @@ import {
BehaviorTypeFromJSON,
BehaviorTypeFromJSONTyped,
BehaviorTypeToJSON,
} from './BehaviorType';
import {
ResponseMeta,
ResponseMetaFromJSON,
ResponseMetaFromJSONTyped,
ResponseMetaToJSON,
} from './';
} from './ResponseMeta';
/**
*

View File

@ -18,11 +18,13 @@ import {
MatchingPartsFromJSON,
MatchingPartsFromJSONTyped,
MatchingPartsToJSON,
} from './MatchingParts';
import {
ResponseMeta,
ResponseMetaFromJSON,
ResponseMetaFromJSONTyped,
ResponseMetaToJSON,
} from './';
} from './ResponseMeta';
/**
*

View File

@ -18,11 +18,13 @@ import {
PetPartTypeFromJSON,
PetPartTypeFromJSONTyped,
PetPartTypeToJSON,
} from './PetPartType';
import {
ResponseMeta,
ResponseMetaFromJSON,
ResponseMetaFromJSONTyped,
ResponseMetaToJSON,
} from './';
} from './ResponseMeta';
/**
*

View File

@ -18,7 +18,7 @@ import {
PartFromJSON,
PartFromJSONTyped,
PartToJSON,
} from './';
} from './Part';
/**
* Contains all the matching parts

View File

@ -18,7 +18,7 @@ import {
ItemIdFromJSON,
ItemIdFromJSONTyped,
ItemIdToJSON,
} from './';
} from './ItemId';
/**
* This represent an error normally linked to a specific item from a previous request

View File

@ -18,19 +18,25 @@ import {
CategoryFromJSON,
CategoryFromJSONTyped,
CategoryToJSON,
} from './Category';
import {
DeploymentRequestStatus,
DeploymentRequestStatusFromJSON,
DeploymentRequestStatusFromJSONTyped,
DeploymentRequestStatusToJSON,
} from './DeploymentRequestStatus';
import {
Tag,
TagFromJSON,
TagFromJSONTyped,
TagToJSON,
} from './Tag';
import {
WarningCode,
WarningCodeFromJSON,
WarningCodeFromJSONTyped,
WarningCodeToJSON,
} from './';
} from './WarningCode';
/**
* A pet for sale in the pet store

View File

@ -18,7 +18,7 @@ import {
ResponseMetaFromJSON,
ResponseMetaFromJSONTyped,
ResponseMetaToJSON,
} from './';
} from './ResponseMeta';
/**
*

View File

@ -18,7 +18,7 @@ import {
ErrorCodeFromJSON,
ErrorCodeFromJSONTyped,
ErrorCodeToJSON,
} from './';
} from './ErrorCode';
/**
* Mandatory part of each response given by our API

View File

@ -18,11 +18,13 @@ import {
CategoryFromJSON,
CategoryFromJSONTyped,
CategoryToJSON,
} from './Category';
import {
Tag,
TagFromJSON,
TagFromJSONTyped,
TagToJSON,
} from './';
} from './Tag';
/**
* A pet for sale in the pet store

View File

@ -18,11 +18,13 @@ import {
CategoryFromJSON,
CategoryFromJSONTyped,
CategoryToJSON,
} from './Category';
import {
Tag,
TagFromJSON,
TagFromJSONTyped,
TagToJSON,
} from './';
} from './Tag';
/**
* A pet for sale in the pet store

View File

@ -18,11 +18,13 @@ import {
CategoryFromJSON,
CategoryFromJSONTyped,
CategoryToJSON,
} from './Category';
import {
Tag,
TagFromJSON,
TagFromJSONTyped,
TagToJSON,
} from './';
} from './Tag';
/**
* A pet for sale in the pet store