From 509c3bdfaacf3ae699b39deb2424d84ab1a0ac79 Mon Sep 17 00:00:00 2001 From: Peter Grman Date: Tue, 10 Oct 2017 20:30:50 +0200 Subject: [PATCH 1/7] fix empty body issue --- .../main/java/io/swagger/codegen/CodegenOperation.java | 9 +++++++++ .../resources/typescript-angular/api.service.mustache | 3 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java index 1273b96c5c2..71b029b39b2 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java @@ -140,6 +140,15 @@ public boolean isRestfulUpdate() { return Arrays.asList("PUT", "PATCH").contains(httpMethod.toUpperCase()) && isMemberPath(); } + /** + * Check if act as Restful update method + * + * @return true if act as Restful update method, false otherwise + */ + public boolean isBodyAllowed() { + return Arrays.asList("PUT", "PATCH", "POST").contains(httpMethod.toUpperCase()); + } + /** * Check if act as Restful destroy method * diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index ea2b19b7885..5cc6097c548 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -263,8 +263,7 @@ export class {{classname}} { {{/hasFormParams}} {{#useHttpClient}} - return this.httpClient.{{httpMethod}}{{^isResponseFile}}{{/isResponseFile}}(`${this.basePath}{{{path}}}`, {{#bodyParam}}{{paramName}}, {{/bodyParam}} - {{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams, {{/hasFormParams}}{ + return this.httpClient.{{httpMethod}}{{^isResponseFile}}{{/isResponseFile}}(`${this.basePath}{{{path}}}`, {{#isBodyAllowed}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}}, {{/isBodyAllowed}}{ {{#hasQueryParams}} params: queryParameters, {{/hasQueryParams}} From 6b03d5abc8ca00bc0ddd79384f4ab47a097ab578 Mon Sep 17 00:00:00 2001 From: Esteban Marin Date: Thu, 19 Oct 2017 13:40:16 +0200 Subject: [PATCH 2/7] #6649: add line break --- .../src/main/resources/typescript-angular/api.service.mustache | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index 5cc6097c548..f944195466d 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -263,7 +263,8 @@ export class {{classname}} { {{/hasFormParams}} {{#useHttpClient}} - return this.httpClient.{{httpMethod}}{{^isResponseFile}}{{/isResponseFile}}(`${this.basePath}{{{path}}}`, {{#isBodyAllowed}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}}, {{/isBodyAllowed}}{ + return this.httpClient.{{httpMethod}}{{^isResponseFile}}{{/isResponseFile}}(`${this.basePath}{{{path}}}`, + {{#isBodyAllowed}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}}, {{/isBodyAllowed}}{ {{#hasQueryParams}} params: queryParameters, {{/hasQueryParams}} From 88799815cc881128e854791c90e56063d42ca8ac Mon Sep 17 00:00:00 2001 From: Esteban Marin Date: Thu, 19 Oct 2017 13:48:33 +0200 Subject: [PATCH 3/7] #6649: improve indentation --- .../typescript-angular/api.service.mustache | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index f944195466d..1555b01c447 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -264,16 +264,18 @@ export class {{classname}} { {{/hasFormParams}} {{#useHttpClient}} return this.httpClient.{{httpMethod}}{{^isResponseFile}}{{/isResponseFile}}(`${this.basePath}{{{path}}}`, - {{#isBodyAllowed}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}}, {{/isBodyAllowed}}{ + {{#isBodyAllowed}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}}, {{/isBodyAllowed}} + { {{#hasQueryParams}} - params: queryParameters, + params: queryParameters, {{/hasQueryParams}} - headers: headers, + headers: headers, {{#isResponseFile}} - responseType: "blob", + responseType: "blob", {{/isResponseFile}} - withCredentials: this.configuration.withCredentials, - }); + withCredentials: this.configuration.withCredentials, + } + ); {{/useHttpClient}} {{^useHttpClient}} let requestOptions: RequestOptionsArgs = new RequestOptions({ From 39a16d45d16459107f041c7467ddeda23cbd3365 Mon Sep 17 00:00:00 2001 From: Esteban Marin Date: Thu, 19 Oct 2017 14:03:09 +0200 Subject: [PATCH 4/7] #6649: improve indentation --- .../main/resources/typescript-angular/api.service.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index 1555b01c447..20be74cfa61 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -263,8 +263,8 @@ export class {{classname}} { {{/hasFormParams}} {{#useHttpClient}} - return this.httpClient.{{httpMethod}}{{^isResponseFile}}{{/isResponseFile}}(`${this.basePath}{{{path}}}`, - {{#isBodyAllowed}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}}, {{/isBodyAllowed}} + return this.httpClient.{{httpMethod}}{{^isResponseFile}}{{/isResponseFile}}(`${this.basePath}{{{path}}}`,{{#isBodyAllowed}} + {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}}, {{/isBodyAllowed}} { {{#hasQueryParams}} params: queryParameters, From 7ea014273a6026cdf71e53c0065fec359a279f61 Mon Sep 17 00:00:00 2001 From: Esteban Marin Date: Thu, 19 Oct 2017 14:41:58 +0200 Subject: [PATCH 5/7] #6649: generate code --- .../npm/api/pet.service.ts | 100 ++++++++++-------- .../npm/api/store.service.ts | 48 +++++---- .../npm/api/user.service.ts | 98 ++++++++++------- .../npm/model/apiResponse.ts | 2 + .../npm/model/category.ts | 2 + .../npm/model/order.ts | 8 +- .../typescript-angular-v4.3/npm/model/pet.ts | 8 +- .../typescript-angular-v4.3/npm/model/tag.ts | 2 + .../typescript-angular-v4.3/npm/model/user.ts | 2 + 9 files changed, 157 insertions(+), 113 deletions(-) diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index ee44df243de..7d23798694c 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -79,11 +79,13 @@ export class PetService { headers = headers.set('Authorization', 'Bearer ' + accessToken); } - return this.httpClient.post(`${this.basePath}/pet`, body, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.post(`${this.basePath}/pet`, + body, + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -110,11 +112,13 @@ export class PetService { headers = headers.set('Authorization', 'Bearer ' + accessToken); } - return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -142,12 +146,14 @@ export class PetService { headers = headers.set('Authorization', 'Bearer ' + accessToken); } - return this.httpClient.get(`${this.basePath}/pet/findByStatus`, - { - params: queryParameters, - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.get(`${this.basePath}/pet/findByStatus`, + + { + params: queryParameters, + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -175,12 +181,14 @@ export class PetService { headers = headers.set('Authorization', 'Bearer ' + accessToken); } - return this.httpClient.get(`${this.basePath}/pet/findByTags`, - { - params: queryParameters, - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.get(`${this.basePath}/pet/findByTags`, + + { + params: queryParameters, + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -200,11 +208,13 @@ export class PetService { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } - return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -227,11 +237,13 @@ export class PetService { headers = headers.set('Authorization', 'Bearer ' + accessToken); } - return this.httpClient.put(`${this.basePath}/pet`, body, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.put(`${this.basePath}/pet`, + body, + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -280,11 +292,13 @@ export class PetService { formParams = formParams.append('status', status) || formParams; } - return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, - convertFormParamsToString ? formParams.toString() : formParams, { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + convertFormParamsToString ? formParams.toString() : formParams, + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -336,11 +350,13 @@ export class PetService { formParams = formParams.append('file', file) || formParams; } - return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, - convertFormParamsToString ? formParams.toString() : formParams, { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + convertFormParamsToString ? formParams.toString() : formParams, + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } } diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index f0cf7dbc1cb..cb9dc34466b 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -70,11 +70,13 @@ export class StoreService { let headers = this.defaultHeaders; - return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -90,11 +92,13 @@ export class StoreService { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } - return this.httpClient.get(`${this.basePath}/store/inventory`, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.get(`${this.basePath}/store/inventory`, + + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -109,11 +113,13 @@ export class StoreService { let headers = this.defaultHeaders; - return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -128,11 +134,13 @@ export class StoreService { let headers = this.defaultHeaders; - return this.httpClient.post(`${this.basePath}/store/order`, body, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.post(`${this.basePath}/store/order`, + body, + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } } diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts index d67fb448fc3..ca6467c9bb4 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -70,11 +70,13 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.post(`${this.basePath}/user`, body, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.post(`${this.basePath}/user`, + body, + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -89,11 +91,13 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.post(`${this.basePath}/user/createWithArray`, body, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.post(`${this.basePath}/user/createWithArray`, + body, + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -108,11 +112,13 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.post(`${this.basePath}/user/createWithList`, body, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.post(`${this.basePath}/user/createWithList`, + body, + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -127,11 +133,13 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -146,11 +154,13 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -177,12 +187,14 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.get(`${this.basePath}/user/login`, - { - params: queryParameters, - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.get(`${this.basePath}/user/login`, + + { + params: queryParameters, + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -193,11 +205,13 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.get(`${this.basePath}/user/logout`, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.get(`${this.basePath}/user/logout`, + + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } /** @@ -216,11 +230,13 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, body, - { - headers: headers, - withCredentials: this.configuration.withCredentials, - }); + return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + body, + { + headers: headers, + withCredentials: this.configuration.withCredentials, + } + ); } } diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts index 3af781cf580..e79fabe8c8c 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts @@ -23,3 +23,5 @@ export interface ApiResponse { message?: string; } + + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts index d09f8d7b265..56608731f95 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts @@ -21,3 +21,5 @@ export interface Category { name?: string; } + + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts index 402a86689c8..84b59f1b09a 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts @@ -33,9 +33,7 @@ export interface Order { } export namespace Order { - export enum StatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' - } + export type StatusEnum = 'placed' | 'approved' | 'delivered'; } + + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts index 0d6137d02cf..c0fc942934c 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts @@ -35,9 +35,7 @@ export interface Pet { } export namespace Pet { - export enum StatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' - } + export type StatusEnum = 'available' | 'pending' | 'sold'; } + + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts index 3ed1eeff8f3..dbfa473f538 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts @@ -21,3 +21,5 @@ export interface Tag { name?: string; } + + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts index f4914ae2608..4dfad607c51 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts @@ -36,3 +36,5 @@ export interface User { userStatus?: number; } + + From ca9a94071ad8017f20060102e277f087dbbf6b23 Mon Sep 17 00:00:00 2001 From: Esteban Marin Date: Thu, 19 Oct 2017 14:43:02 +0200 Subject: [PATCH 6/7] #6649: generate samples --- .../petstore/typescript-angular-v4.3/npm/api/pet.service.ts | 4 ---- .../petstore/typescript-angular-v4.3/npm/api/store.service.ts | 3 --- .../petstore/typescript-angular-v4.3/npm/api/user.service.ts | 4 ---- 3 files changed, 11 deletions(-) diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index 7d23798694c..41245e5eae0 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -113,7 +113,6 @@ export class PetService { } return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, - { headers: headers, withCredentials: this.configuration.withCredentials, @@ -147,7 +146,6 @@ export class PetService { } return this.httpClient.get(`${this.basePath}/pet/findByStatus`, - { params: queryParameters, headers: headers, @@ -182,7 +180,6 @@ export class PetService { } return this.httpClient.get(`${this.basePath}/pet/findByTags`, - { params: queryParameters, headers: headers, @@ -209,7 +206,6 @@ export class PetService { } return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, - { headers: headers, withCredentials: this.configuration.withCredentials, diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index cb9dc34466b..c8f2ddf25aa 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -71,7 +71,6 @@ export class StoreService { let headers = this.defaultHeaders; return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, - { headers: headers, withCredentials: this.configuration.withCredentials, @@ -93,7 +92,6 @@ export class StoreService { } return this.httpClient.get(`${this.basePath}/store/inventory`, - { headers: headers, withCredentials: this.configuration.withCredentials, @@ -114,7 +112,6 @@ export class StoreService { let headers = this.defaultHeaders; return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, - { headers: headers, withCredentials: this.configuration.withCredentials, diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts index ca6467c9bb4..bc6e2048f70 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -134,7 +134,6 @@ export class UserService { let headers = this.defaultHeaders; return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, - { headers: headers, withCredentials: this.configuration.withCredentials, @@ -155,7 +154,6 @@ export class UserService { let headers = this.defaultHeaders; return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, - { headers: headers, withCredentials: this.configuration.withCredentials, @@ -188,7 +186,6 @@ export class UserService { let headers = this.defaultHeaders; return this.httpClient.get(`${this.basePath}/user/login`, - { params: queryParameters, headers: headers, @@ -206,7 +203,6 @@ export class UserService { let headers = this.defaultHeaders; return this.httpClient.get(`${this.basePath}/user/logout`, - { headers: headers, withCredentials: this.configuration.withCredentials, From 755a1d84896d5039f47665de2e64c2ffbfbd8dcc Mon Sep 17 00:00:00 2001 From: Esteban Marin Date: Thu, 19 Oct 2017 14:52:45 +0200 Subject: [PATCH 7/7] #6649: fix method docs --- .../src/main/java/io/swagger/codegen/CodegenOperation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java index 71b029b39b2..64e76df0482 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java @@ -141,9 +141,9 @@ public boolean isRestfulUpdate() { } /** - * Check if act as Restful update method + * Check if body param is allowed for the request method * - * @return true if act as Restful update method, false otherwise + * @return true request method is PUT, PATCH or POST; false otherwise */ public boolean isBodyAllowed() { return Arrays.asList("PUT", "PATCH", "POST").contains(httpMethod.toUpperCase());