diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache index 312b6320e0d..20f21ef5c9f 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache @@ -3,7 +3,7 @@ export function instanceOf{{classname}}(value: any): boolean { for (const key in {{classname}}) { if (Object.prototype.hasOwnProperty.call({{classname}}, key)) { - if ({{classname}}[key] === value) { + if (({{classname}} as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumClass.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumClass.ts index d83d77aa5f5..3233ca6c949 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumClass.ts @@ -28,7 +28,7 @@ export type EnumClass = typeof EnumClass[keyof typeof EnumClass]; export function instanceOfEnumClass(value: any): boolean { for (const key in EnumClass) { if (Object.prototype.hasOwnProperty.call(EnumClass, key)) { - if (EnumClass[key] === value) { + if ((EnumClass as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnum.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnum.ts index a35b7561819..b4427d5dad3 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnum.ts @@ -28,7 +28,7 @@ export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum]; export function instanceOfOuterEnum(value: any): boolean { for (const key in OuterEnum) { if (Object.prototype.hasOwnProperty.call(OuterEnum, key)) { - if (OuterEnum[key] === value) { + if ((OuterEnum as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumDefaultValue.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumDefaultValue.ts index 08c50c71d68..5c44e185371 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumDefaultValue.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumDefaultValue.ts @@ -28,7 +28,7 @@ export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof Ou export function instanceOfOuterEnumDefaultValue(value: any): boolean { for (const key in OuterEnumDefaultValue) { if (Object.prototype.hasOwnProperty.call(OuterEnumDefaultValue, key)) { - if (OuterEnumDefaultValue[key] === value) { + if ((OuterEnumDefaultValue as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumInteger.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumInteger.ts index 4c017a1ceb5..33609e9b0f3 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumInteger.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumInteger.ts @@ -28,7 +28,7 @@ export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInt export function instanceOfOuterEnumInteger(value: any): boolean { for (const key in OuterEnumInteger) { if (Object.prototype.hasOwnProperty.call(OuterEnumInteger, key)) { - if (OuterEnumInteger[key] === value) { + if ((OuterEnumInteger as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumIntegerDefaultValue.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumIntegerDefaultValue.ts index 8e16b56eeda..08927e2f8f8 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumIntegerDefaultValue.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumIntegerDefaultValue.ts @@ -28,7 +28,7 @@ export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[k export function instanceOfOuterEnumIntegerDefaultValue(value: any): boolean { for (const key in OuterEnumIntegerDefaultValue) { if (Object.prototype.hasOwnProperty.call(OuterEnumIntegerDefaultValue, key)) { - if (OuterEnumIntegerDefaultValue[key] === value) { + if ((OuterEnumIntegerDefaultValue as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SingleRefType.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SingleRefType.ts index 7dbee0a8e95..8daaecf3c49 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SingleRefType.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SingleRefType.ts @@ -27,7 +27,7 @@ export type SingleRefType = typeof SingleRefType[keyof typeof SingleRefType]; export function instanceOfSingleRefType(value: any): boolean { for (const key in SingleRefType) { if (Object.prototype.hasOwnProperty.call(SingleRefType, key)) { - if (SingleRefType[key] === value) { + if ((SingleRefType as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts index a0c1b58a29e..225a3907844 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts @@ -28,7 +28,7 @@ export type NumberEnum = typeof NumberEnum[keyof typeof NumberEnum]; export function instanceOfNumberEnum(value: any): boolean { for (const key in NumberEnum) { if (Object.prototype.hasOwnProperty.call(NumberEnum, key)) { - if (NumberEnum[key] === value) { + if ((NumberEnum as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts index c59850ed4b6..1f7477bf168 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts @@ -28,7 +28,7 @@ export type StringEnum = typeof StringEnum[keyof typeof StringEnum]; export function instanceOfStringEnum(value: any): boolean { for (const key in StringEnum) { if (Object.prototype.hasOwnProperty.call(StringEnum, key)) { - if (StringEnum[key] === value) { + if ((StringEnum as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/BehaviorType.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/BehaviorType.ts index 481793ab0bd..a16d3f8c265 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/BehaviorType.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/BehaviorType.ts @@ -28,7 +28,7 @@ export type BehaviorType = typeof BehaviorType[keyof typeof BehaviorType]; export function instanceOfBehaviorType(value: any): boolean { for (const key in BehaviorType) { if (Object.prototype.hasOwnProperty.call(BehaviorType, key)) { - if (BehaviorType[key] === value) { + if ((BehaviorType as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DeploymentRequestStatus.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DeploymentRequestStatus.ts index f04bfb6e45b..0a84d2dce81 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DeploymentRequestStatus.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DeploymentRequestStatus.ts @@ -37,7 +37,7 @@ export type DeploymentRequestStatus = typeof DeploymentRequestStatus[keyof typeo export function instanceOfDeploymentRequestStatus(value: any): boolean { for (const key in DeploymentRequestStatus) { if (Object.prototype.hasOwnProperty.call(DeploymentRequestStatus, key)) { - if (DeploymentRequestStatus[key] === value) { + if ((DeploymentRequestStatus as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ErrorCode.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ErrorCode.ts index 13fe193a73f..669c957006c 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ErrorCode.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ErrorCode.ts @@ -43,7 +43,7 @@ export type ErrorCode = typeof ErrorCode[keyof typeof ErrorCode]; export function instanceOfErrorCode(value: any): boolean { for (const key in ErrorCode) { if (Object.prototype.hasOwnProperty.call(ErrorCode, key)) { - if (ErrorCode[key] === value) { + if ((ErrorCode as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetPartType.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetPartType.ts index 1aa5863611e..d03752c43dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetPartType.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetPartType.ts @@ -28,7 +28,7 @@ export type PetPartType = typeof PetPartType[keyof typeof PetPartType]; export function instanceOfPetPartType(value: any): boolean { for (const key in PetPartType) { if (Object.prototype.hasOwnProperty.call(PetPartType, key)) { - if (PetPartType[key] === value) { + if ((PetPartType as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/WarningCode.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/WarningCode.ts index 4554cb6dff0..3d73bec1353 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/WarningCode.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/WarningCode.ts @@ -28,7 +28,7 @@ export type WarningCode = typeof WarningCode[keyof typeof WarningCode]; export function instanceOfWarningCode(value: any): boolean { for (const key in WarningCode) { if (Object.prototype.hasOwnProperty.call(WarningCode, key)) { - if (WarningCode[key] === value) { + if ((WarningCode as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumClass.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumClass.ts index d83d77aa5f5..3233ca6c949 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumClass.ts @@ -28,7 +28,7 @@ export type EnumClass = typeof EnumClass[keyof typeof EnumClass]; export function instanceOfEnumClass(value: any): boolean { for (const key in EnumClass) { if (Object.prototype.hasOwnProperty.call(EnumClass, key)) { - if (EnumClass[key] === value) { + if ((EnumClass as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnum.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnum.ts index a35b7561819..b4427d5dad3 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnum.ts @@ -28,7 +28,7 @@ export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum]; export function instanceOfOuterEnum(value: any): boolean { for (const key in OuterEnum) { if (Object.prototype.hasOwnProperty.call(OuterEnum, key)) { - if (OuterEnum[key] === value) { + if ((OuterEnum as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumDefaultValue.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumDefaultValue.ts index 08c50c71d68..5c44e185371 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumDefaultValue.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumDefaultValue.ts @@ -28,7 +28,7 @@ export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof Ou export function instanceOfOuterEnumDefaultValue(value: any): boolean { for (const key in OuterEnumDefaultValue) { if (Object.prototype.hasOwnProperty.call(OuterEnumDefaultValue, key)) { - if (OuterEnumDefaultValue[key] === value) { + if ((OuterEnumDefaultValue as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumInteger.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumInteger.ts index 4c017a1ceb5..33609e9b0f3 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumInteger.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumInteger.ts @@ -28,7 +28,7 @@ export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInt export function instanceOfOuterEnumInteger(value: any): boolean { for (const key in OuterEnumInteger) { if (Object.prototype.hasOwnProperty.call(OuterEnumInteger, key)) { - if (OuterEnumInteger[key] === value) { + if ((OuterEnumInteger as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumIntegerDefaultValue.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumIntegerDefaultValue.ts index 8e16b56eeda..08927e2f8f8 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumIntegerDefaultValue.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumIntegerDefaultValue.ts @@ -28,7 +28,7 @@ export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[k export function instanceOfOuterEnumIntegerDefaultValue(value: any): boolean { for (const key in OuterEnumIntegerDefaultValue) { if (Object.prototype.hasOwnProperty.call(OuterEnumIntegerDefaultValue, key)) { - if (OuterEnumIntegerDefaultValue[key] === value) { + if ((OuterEnumIntegerDefaultValue as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SingleRefType.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SingleRefType.ts index 7dbee0a8e95..8daaecf3c49 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SingleRefType.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SingleRefType.ts @@ -27,7 +27,7 @@ export type SingleRefType = typeof SingleRefType[keyof typeof SingleRefType]; export function instanceOfSingleRefType(value: any): boolean { for (const key in SingleRefType) { if (Object.prototype.hasOwnProperty.call(SingleRefType, key)) { - if (SingleRefType[key] === value) { + if ((SingleRefType as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/NumberEnum.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/NumberEnum.ts index 5b3ea298b9d..18a96213d14 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/NumberEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/NumberEnum.ts @@ -27,7 +27,7 @@ export enum NumberEnum { export function instanceOfNumberEnum(value: any): boolean { for (const key in NumberEnum) { if (Object.prototype.hasOwnProperty.call(NumberEnum, key)) { - if (NumberEnum[key] === value) { + if ((NumberEnum as Record)[key] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/StringEnum.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/StringEnum.ts index 21f232a76a9..43acb9cc477 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/StringEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/StringEnum.ts @@ -27,7 +27,7 @@ export enum StringEnum { export function instanceOfStringEnum(value: any): boolean { for (const key in StringEnum) { if (Object.prototype.hasOwnProperty.call(StringEnum, key)) { - if (StringEnum[key] === value) { + if ((StringEnum as Record)[key] === value) { return true; } }