From 2016bc086fc363ad59d6cf08a5bdeeff8963e50d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirik=20Andr=C3=A9=20Eids=C3=A5?= Date: Wed, 28 Aug 2019 13:11:22 +0200 Subject: [PATCH] Set Content-Type to application/json when multipart param isModel typescript-angular (#3776) (#3779) --- .../src/main/resources/typescript-angular/api.service.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index eba3a2a0899..69743890631 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -342,7 +342,7 @@ export class {{classname}} { {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined) { - {{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', {{^isModel}}{{paramName}}{{/isModel}}{{#isModel}}useForm ? JSON.stringify({{paramName}}) : {{paramName}}{{/isModel}}){{#useHttpClient}} as any || formParams{{/useHttpClient}}; + {{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', {{^isModel}}{{paramName}}{{/isModel}}{{#isModel}}useForm ? new Blob([JSON.stringify({{paramName}})], {type: 'application/json'}) : {{paramName}}{{/isModel}}){{#useHttpClient}} as any || formParams{{/useHttpClient}}; } {{/isListContainer}} {{/formParams}}