diff --git a/src/main/resources/handlebars/typescript-angular/api.service.mustache b/src/main/resources/handlebars/typescript-angular/api.service.mustache index 71cc3d46d0..24291587d8 100644 --- a/src/main/resources/handlebars/typescript-angular/api.service.mustache +++ b/src/main/resources/handlebars/typescript-angular/api.service.mustache @@ -320,13 +320,13 @@ export class {{classname}} { {{/hasFormParams}} {{#useHttpClient}} - return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}({{httpMethod}},`${this.basePath}{{{path}}}`, + return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}('{{httpMethod}}',`${this.basePath}{{{path}}}`, { {{#bodyParam}} - body: {{paramName}} + body: {{paramName}}, {{/bodyParam}} {{#hasFormParams}} - body: convertFormParamsToString ? formParams.toString() : formParams + body: convertFormParamsToString ? formParams.toString() : formParams, {{/hasFormParams}} {{#hasQueryParams}} params: queryParameters, @@ -343,7 +343,7 @@ export class {{classname}} { {{/useHttpClient}} {{^useHttpClient}} let requestOptions: RequestOptionsArgs = new RequestOptions({ - method: {{httpMethod}}, + method: '{{httpMethod}}', headers: headers, {{#bodyParam}} body: {{paramName}} == null ? '' : JSON.stringify({{paramName}}), // https://github.com/angular/angular/issues/10612 @@ -357,7 +357,7 @@ export class {{classname}} { {{#hasQueryParams}} search: queryParameters, {{/hasQueryParams}} - withCredentials:this.configuration.withCredentials + withCredentials: this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 if (extraHttpRequestParams) { diff --git a/src/main/resources/mustache/typescript-angular/api.service.mustache b/src/main/resources/mustache/typescript-angular/api.service.mustache index e25822b31f..8c03561e5b 100644 --- a/src/main/resources/mustache/typescript-angular/api.service.mustache +++ b/src/main/resources/mustache/typescript-angular/api.service.mustache @@ -320,13 +320,13 @@ export class {{classname}} { {{/hasFormParams}} {{#useHttpClient}} - return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}({{httpMethod}},`${this.basePath}{{{path}}}`, + return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}('{{httpMethod}}',`${this.basePath}{{{path}}}`, { {{#bodyParam}} - body: {{paramName}} + body: {{paramName}}, {{/bodyParam}} {{#hasFormParams}} - body: convertFormParamsToString ? formParams.toString() : formParams + body: convertFormParamsToString ? formParams.toString() : formParams, {{/hasFormParams}} {{#hasQueryParams}} params: queryParameters, @@ -343,7 +343,7 @@ export class {{classname}} { {{/useHttpClient}} {{^useHttpClient}} let requestOptions: RequestOptionsArgs = new RequestOptions({ - method: {{httpMethod}}, + method: '{{httpMethod}}', headers: headers, {{#bodyParam}} body: {{paramName}} == null ? '' : JSON.stringify({{paramName}}), // https://github.com/angular/angular/issues/10612 @@ -357,7 +357,7 @@ export class {{classname}} { {{#hasQueryParams}} search: queryParameters, {{/hasQueryParams}} - withCredentials:this.configuration.withCredentials + withCredentials: this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 if (extraHttpRequestParams) {