[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'; import { exists, mapValues } from '../runtime';
{{#hasImports}} {{#hasImports}}
{{#imports}}
import { import {
{{#imports}}
{{{.}}}, {{{.}}},
{{.}}FromJSON, {{.}}FromJSON,
{{.}}FromJSONTyped, {{.}}FromJSONTyped,
{{.}}ToJSON, {{.}}ToJSON,
{{/imports}} } from './{{.}}';
} from './'; {{/imports}}
{{/hasImports}} {{/hasImports}}
{{#discriminator}} {{#discriminator}}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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