forked from loafle/openapi-generator-original
[typescript] fix compilation error for file upload (#10288)
This commit is contained in:
@@ -111,14 +111,16 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
|
||||
localVarFormParams.append('{{baseName}}', {{paramName}} as any);
|
||||
{{/isFile}}
|
||||
{{#isFile}}
|
||||
{{#platforms}}
|
||||
{{#node}}
|
||||
localVarFormParams.append('{{baseName}}', {{paramName}}.data, {{paramName}}.name);
|
||||
{{/node}}
|
||||
{{^node}}
|
||||
localVarFormParams.append('{{baseName}}', {{paramName}}, {{paramName}}.name);
|
||||
{{/node}}
|
||||
{{/platforms}}
|
||||
if (localVarFormParams instanceof FormData) {
|
||||
{{#platforms}}
|
||||
{{#node}}
|
||||
localVarFormParams.append('{{baseName}}', {{paramName}}.data, {{paramName}}.name);
|
||||
{{/node}}
|
||||
{{^node}}
|
||||
localVarFormParams.append('{{baseName}}', {{paramName}}, {{paramName}}.name);
|
||||
{{/node}}
|
||||
{{/platforms}}
|
||||
}
|
||||
{{/isFile}}
|
||||
}
|
||||
{{/isArray}}
|
||||
|
||||
@@ -357,7 +357,9 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
}
|
||||
if (file !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('file', file.data, file.name);
|
||||
if (localVarFormParams instanceof FormData) {
|
||||
localVarFormParams.append('file', file.data, file.name);
|
||||
}
|
||||
}
|
||||
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
@@ -355,7 +355,9 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
}
|
||||
if (file !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('file', file, file.name);
|
||||
if (localVarFormParams instanceof FormData) {
|
||||
localVarFormParams.append('file', file, file.name);
|
||||
}
|
||||
}
|
||||
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
@@ -359,7 +359,9 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
}
|
||||
if (file !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('file', file.data, file.name);
|
||||
if (localVarFormParams instanceof FormData) {
|
||||
localVarFormParams.append('file', file.data, file.name);
|
||||
}
|
||||
}
|
||||
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
@@ -355,7 +355,9 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
}
|
||||
if (file !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('file', file, file.name);
|
||||
if (localVarFormParams instanceof FormData) {
|
||||
localVarFormParams.append('file', file, file.name);
|
||||
}
|
||||
}
|
||||
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
@@ -357,7 +357,9 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
}
|
||||
if (file !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('file', file.data, file.name);
|
||||
if (localVarFormParams instanceof FormData) {
|
||||
localVarFormParams.append('file', file.data, file.name);
|
||||
}
|
||||
}
|
||||
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
Reference in New Issue
Block a user