Skip to content

Commit 7d94b9b

Browse files
authored
Merge pull request spring-io#576 from cmalard/fix-angular
[typescript-angular] Fix output
2 parents 758c3e1 + 959dd6e commit 7d94b9b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/main/resources/handlebars/typescript-angular/api.service.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,13 @@ export class {{classname}} {
320320

321321
{{/hasFormParams}}
322322
{{#useHttpClient}}
323-
return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}({{httpMethod}},`${this.basePath}{{{path}}}`,
323+
return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}('{{httpMethod}}',`${this.basePath}{{{path}}}`,
324324
{
325325
{{#bodyParam}}
326-
body: {{paramName}}
326+
body: {{paramName}},
327327
{{/bodyParam}}
328328
{{#hasFormParams}}
329-
body: convertFormParamsToString ? formParams.toString() : formParams
329+
body: convertFormParamsToString ? formParams.toString() : formParams,
330330
{{/hasFormParams}}
331331
{{#hasQueryParams}}
332332
params: queryParameters,
@@ -343,7 +343,7 @@ export class {{classname}} {
343343
{{/useHttpClient}}
344344
{{^useHttpClient}}
345345
let requestOptions: RequestOptionsArgs = new RequestOptions({
346-
method: {{httpMethod}},
346+
method: '{{httpMethod}}',
347347
headers: headers,
348348
{{#bodyParam}}
349349
body: {{paramName}} == null ? '' : JSON.stringify({{paramName}}), // https://github.com/angular/angular/issues/10612
@@ -357,7 +357,7 @@ export class {{classname}} {
357357
{{#hasQueryParams}}
358358
search: queryParameters,
359359
{{/hasQueryParams}}
360-
withCredentials:this.configuration.withCredentials
360+
withCredentials: this.configuration.withCredentials
361361
});
362362
// https://github.com/swagger-api/swagger-codegen/issues/4037
363363
if (extraHttpRequestParams) {

src/main/resources/mustache/typescript-angular/api.service.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,13 @@ export class {{classname}} {
320320

321321
{{/hasFormParams}}
322322
{{#useHttpClient}}
323-
return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}({{httpMethod}},`${this.basePath}{{{path}}}`,
323+
return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}('{{httpMethod}}',`${this.basePath}{{{path}}}`,
324324
{
325325
{{#bodyParam}}
326-
body: {{paramName}}
326+
body: {{paramName}},
327327
{{/bodyParam}}
328328
{{#hasFormParams}}
329-
body: convertFormParamsToString ? formParams.toString() : formParams
329+
body: convertFormParamsToString ? formParams.toString() : formParams,
330330
{{/hasFormParams}}
331331
{{#hasQueryParams}}
332332
params: queryParameters,
@@ -343,7 +343,7 @@ export class {{classname}} {
343343
{{/useHttpClient}}
344344
{{^useHttpClient}}
345345
let requestOptions: RequestOptionsArgs = new RequestOptions({
346-
method: {{httpMethod}},
346+
method: '{{httpMethod}}',
347347
headers: headers,
348348
{{#bodyParam}}
349349
body: {{paramName}} == null ? '' : JSON.stringify({{paramName}}), // https://github.com/angular/angular/issues/10612
@@ -357,7 +357,7 @@ export class {{classname}} {
357357
{{#hasQueryParams}}
358358
search: queryParameters,
359359
{{/hasQueryParams}}
360-
withCredentials:this.configuration.withCredentials
360+
withCredentials: this.configuration.withCredentials
361361
});
362362
// https://github.com/swagger-api/swagger-codegen/issues/4037
363363
if (extraHttpRequestParams) {

0 commit comments

Comments
 (0)