fix(typescript-fetch): use type modifier on imports for discriminator.mappedModels (#21397)

* typescript-fetch: use `type` modifier on imports for `discriminator.mappedModels`

This ensures that the generated code works when `--verbatimModuleSyntax` is enabled for the TypeScript compiler.
Regular imports already use the `type` modifier, so this should not be a breaking change.

* update samples
This commit is contained in:
Stefan Paul Noack 2025-06-18 16:50:20 +02:00 committed by GitHub
parent 623463a6ed
commit 8d8e3ddf16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 8 deletions

View File

@ -13,7 +13,7 @@ import {
{{/hasImports}}
{{#discriminator}}
{{#discriminator.mappedModels}}
import { {{modelName}}, {{modelName}}FromJSONTyped, {{modelName}}ToJSON, {{modelName}}ToJSONTyped } from './{{modelName}}{{importFileExtension}}';
import { type {{modelName}}, {{modelName}}FromJSONTyped, {{modelName}}ToJSON, {{modelName}}ToJSONTyped } from './{{modelName}}{{importFileExtension}}';
{{/discriminator.mappedModels}}
{{/discriminator}}
{{>modelGenericInterfaces}}

View File

@ -21,8 +21,8 @@ import {
BranchDtoToJSONTyped,
} from './BranchDto';
import { InternalAuthenticatedUserDto, InternalAuthenticatedUserDtoFromJSONTyped, InternalAuthenticatedUserDtoToJSON, InternalAuthenticatedUserDtoToJSONTyped } from './InternalAuthenticatedUserDto';
import { RemoteAuthenticatedUserDto, RemoteAuthenticatedUserDtoFromJSONTyped, RemoteAuthenticatedUserDtoToJSON, RemoteAuthenticatedUserDtoToJSONTyped } from './RemoteAuthenticatedUserDto';
import { type InternalAuthenticatedUserDto, InternalAuthenticatedUserDtoFromJSONTyped, InternalAuthenticatedUserDtoToJSON, InternalAuthenticatedUserDtoToJSONTyped } from './InternalAuthenticatedUserDto';
import { type RemoteAuthenticatedUserDto, RemoteAuthenticatedUserDtoFromJSONTyped, RemoteAuthenticatedUserDtoToJSON, RemoteAuthenticatedUserDtoToJSONTyped } from './RemoteAuthenticatedUserDto';
/**
*
* @export

View File

@ -13,8 +13,8 @@
*/
import { mapValues } from '../runtime';
import { Cat, CatFromJSONTyped, CatToJSON, CatToJSONTyped } from './Cat';
import { Dog, DogFromJSONTyped, DogToJSON, DogToJSONTyped } from './Dog';
import { type Cat, CatFromJSONTyped, CatToJSON, CatToJSONTyped } from './Cat';
import { type Dog, DogFromJSONTyped, DogToJSON, DogToJSONTyped } from './Dog';
/**
*
* @export

View File

@ -13,7 +13,7 @@
*/
import { mapValues } from '../runtime';
import { ChildWithNullable, ChildWithNullableFromJSONTyped, ChildWithNullableToJSON, ChildWithNullableToJSONTyped } from './ChildWithNullable';
import { type ChildWithNullable, ChildWithNullableFromJSONTyped, ChildWithNullableToJSON, ChildWithNullableToJSONTyped } from './ChildWithNullable';
/**
*
* @export

View File

@ -13,8 +13,8 @@
*/
import { mapValues } from '../runtime';
import { Cat, CatFromJSONTyped, CatToJSON, CatToJSONTyped } from './Cat';
import { Dog, DogFromJSONTyped, DogToJSON, DogToJSONTyped } from './Dog';
import { type Cat, CatFromJSONTyped, CatToJSON, CatToJSONTyped } from './Cat';
import { type Dog, DogFromJSONTyped, DogToJSON, DogToJSONTyped } from './Dog';
/**
*
* @export