From d64ec14ab4d6e5d4d7f7746e04256887cb1ab8f5 Mon Sep 17 00:00:00 2001 From: Daniel Schreiber Date: Fri, 23 Aug 2019 13:54:14 +0200 Subject: [PATCH] [typescript-angular] Encode objects for multipart/form-data with json - fixes #2733 (#3738) --- .../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 96c92290b4e..eba3a2a0899 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}}', {{paramName}}){{#useHttpClient}} as any || formParams{{/useHttpClient}}; + {{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', {{^isModel}}{{paramName}}{{/isModel}}{{#isModel}}useForm ? JSON.stringify({{paramName}}) : {{paramName}}{{/isModel}}){{#useHttpClient}} as any || formParams{{/useHttpClient}}; } {{/isListContainer}} {{/formParams}}