forked from loafle/openapi-generator-original
[typescript-fetch] Fix API-generation of referenced enums for multipart/form-data (#19016)
* [typescript-fetch] Fix API-generation of referenced enums * [typescript-fetch] re-generate samples
This commit is contained in:
parent
daa4886865
commit
5d61f71cdd
@ -1120,6 +1120,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
this.isMap = cp.isMap;
|
||||
this.isFile = cp.isFile;
|
||||
this.isEnum = cp.isEnum;
|
||||
this.isEnumRef = cp.isEnumRef;
|
||||
this._enum = cp._enum;
|
||||
this.allowableValues = cp.allowableValues;
|
||||
this.items = cp.items;
|
||||
@ -1280,6 +1281,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
this.isArray = cp.isArray;
|
||||
this.isMap = cp.isMap;
|
||||
this.isEnum = cp.isEnum;
|
||||
this.isEnumRef = cp.isEnumRef;
|
||||
this.isReadOnly = cp.isReadOnly;
|
||||
this.isWriteOnly = cp.isWriteOnly;
|
||||
this.isNullable = cp.isNullable;
|
||||
|
@ -260,11 +260,16 @@ export class {{classname}} extends runtime.BaseAPI {
|
||||
formParams.append('{{baseName}}', requestParameters['{{paramName}}'] as any);
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{#isEnumRef}}
|
||||
formParams.append('{{baseName}}', requestParameters['{{paramName}}'] as any);
|
||||
{{/isEnumRef}}
|
||||
{{^isEnumRef}}
|
||||
{{^withoutRuntimeChecks}}
|
||||
formParams.append('{{baseName}}', new Blob([JSON.stringify({{{dataType}}}ToJSON(requestParameters['{{paramName}}']))], { type: "application/json", }));
|
||||
{{/withoutRuntimeChecks}}{{#withoutRuntimeChecks}}
|
||||
formParams.append('{{baseName}}', new Blob([JSON.stringify(requestParameters['{{paramName}}'])], { type: "application/json", }));
|
||||
{{/withoutRuntimeChecks}}
|
||||
{{/isEnumRef}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isDateTimeType}}
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ export interface AllOfWithSingleRef {
|
||||
singleRefType?: SingleRefType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given object implements the AllOfWithSingleRef interface.
|
||||
*/
|
||||
|
@ -34,6 +34,8 @@ export interface OuterObjectWithEnumProperty {
|
||||
value: OuterEnumInteger;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given object implements the OuterObjectWithEnumProperty interface.
|
||||
*/
|
||||
|
@ -58,6 +58,8 @@ export interface EnumPatternObject {
|
||||
nullableNumberEnum?: NumberEnum | null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given object implements the EnumPatternObject interface.
|
||||
*/
|
||||
|
@ -46,6 +46,8 @@ export interface GetBehaviorTypeResponse {
|
||||
data?: BehaviorType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GetBehaviorTypeResponse interface.
|
||||
*/
|
||||
|
@ -46,6 +46,8 @@ export interface GetPetPartTypeResponse {
|
||||
data?: PetPartType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GetPetPartTypeResponse interface.
|
||||
*/
|
||||
|
@ -40,6 +40,8 @@ export interface AllOfWithSingleRef {
|
||||
singleRefType?: SingleRefType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given object implements the AllOfWithSingleRef interface.
|
||||
*/
|
||||
|
@ -34,6 +34,8 @@ export interface OuterObjectWithEnumProperty {
|
||||
value: OuterEnumInteger;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given object implements the OuterObjectWithEnumProperty interface.
|
||||
*/
|
||||
|
@ -58,6 +58,8 @@ export interface EnumPatternObject {
|
||||
nullableNumberEnum?: NumberEnum | null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given object implements the EnumPatternObject interface.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user