From f90f2141211b9a5c71b05ffdf41379ebecb156c1 Mon Sep 17 00:00:00 2001 From: Erik Seliger Date: Wed, 31 Jul 2019 22:24:02 +0200 Subject: [PATCH] fix(typescript-angular): improve small template issues (#3466) * fix(typescript-angular): improve small template issues * fix: template adjustments * fix: repair hasSomeFormParamsLogic * Update modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java Co-Authored-By: Esteban Gehring --- .../TypeScriptAngularClientCodegen.java | 6 ++++ .../typescript-angular/api.service.mustache | 19 +++++++++++ .../typescript-angular/encoder.mustache | 14 ++++---- .../default/api/pet.service.ts | 19 ++--------- .../default/api/store.service.ts | 24 +------------ .../default/api/user.service.ts | 34 +++---------------- .../typescript-angular-v2/default/encoder.ts | 8 ++--- .../npm/api/pet.service.ts | 19 ++--------- .../npm/api/store.service.ts | 24 +------------ .../npm/api/user.service.ts | 34 +++---------------- .../typescript-angular-v2/npm/encoder.ts | 8 ++--- .../with-interfaces/api/pet.service.ts | 19 ++--------- .../with-interfaces/api/store.service.ts | 24 +------------ .../with-interfaces/api/user.service.ts | 34 +++---------------- .../with-interfaces/encoder.ts | 8 ++--- .../npm/api/pet.service.ts | 19 ++--------- .../npm/api/store.service.ts | 24 +------------ .../npm/api/user.service.ts | 34 +++---------------- .../typescript-angular-v4.3/npm/encoder.ts | 6 ++-- .../npm/api/pet.service.ts | 19 ++--------- .../npm/api/store.service.ts | 24 +------------ .../npm/api/user.service.ts | 34 +++---------------- .../typescript-angular-v4/npm/encoder.ts | 8 ++--- .../builds/default/api/pet.service.ts | 19 ++--------- .../builds/default/api/store.service.ts | 24 +------------ .../builds/default/api/user.service.ts | 34 +++---------------- .../builds/default/encoder.ts | 6 ++-- .../builds/with-npm/api/pet.service.ts | 19 ++--------- .../builds/with-npm/api/store.service.ts | 24 +------------ .../builds/with-npm/api/user.service.ts | 34 +++---------------- .../builds/with-npm/encoder.ts | 6 ++-- .../builds/default/api/pet.service.ts | 19 ++--------- .../builds/default/api/store.service.ts | 24 +------------ .../builds/default/api/user.service.ts | 34 +++---------------- .../builds/default/encoder.ts | 6 ++-- .../builds/with-npm/api/pet.service.ts | 19 ++--------- .../builds/with-npm/api/store.service.ts | 24 +------------ .../builds/with-npm/api/user.service.ts | 34 +++---------------- .../builds/with-npm/encoder.ts | 6 ++-- .../builds/default/api/pet.service.ts | 19 ++--------- .../builds/default/api/store.service.ts | 24 +------------ .../builds/default/api/user.service.ts | 34 +++---------------- .../builds/default/encoder.ts | 6 ++-- .../builds/with-npm/api/pet.service.ts | 19 ++--------- .../builds/with-npm/api/store.service.ts | 24 +------------ .../builds/with-npm/api/user.service.ts | 34 +++---------------- .../builds/with-npm/encoder.ts | 6 ++-- .../builds/default/api/pet.service.ts | 19 ++--------- .../builds/default/api/store.service.ts | 24 +------------ .../builds/default/api/user.service.ts | 34 +++---------------- .../builds/default/encoder.ts | 6 ++-- .../builds/with-npm/api/pet.service.ts | 19 ++--------- .../builds/with-npm/api/store.service.ts | 24 +------------ .../builds/with-npm/api/user.service.ts | 34 +++---------------- .../builds/with-npm/encoder.ts | 6 ++-- 55 files changed, 166 insertions(+), 960 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 31c5091b88a..8fe22b430cc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -352,7 +352,11 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode objs.put("apiFilename", getApiFilenameFromClassname(objs.get("classname").toString())); List ops = (List) objs.get("operation"); + boolean hasSomeFormParams = false; for (CodegenOperation op : ops) { + if (op.getHasFormParams()) { + hasSomeFormParams = true; + } if ((boolean) additionalProperties.get("useHttpClient")) { op.httpMethod = op.httpMethod.toLowerCase(Locale.ENGLISH); } else { @@ -428,6 +432,8 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode op.path = pathBuffer.toString(); } + operations.put("hasSomeFormParams", hasSomeFormParams); + // Add additional filename information for model imports in the services List> imports = (List>) operations.get("imports"); for (Map im : imports) { 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 85573aa8b13..96c92290b4e 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 @@ -82,6 +82,7 @@ export class {{classname}} { {{/useHttpClient}} } +{{#hasSomeFormParams}} /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -95,6 +96,7 @@ export class {{classname}} { } return false; } +{{/hasSomeFormParams}} {{^useHttpClient}} {{! Before HttpClient implementation or method overloading we relied on 2 functions, 1 to return the straight body as json @@ -129,8 +131,12 @@ export class {{classname}} { {{#operation}} /** +{{#summary}} * {{summary}} +{{/summary}} +{{#notes}} * {{notes}} +{{/notes}} {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}{{#useHttpClient}}* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress.{{/useHttpClient}} @@ -256,12 +262,25 @@ export class {{classname}} { {{/useHttpClient}} } +{{#bodyParam}} +{{- duplicated below, don't forget to change}} // to determine the Content-Type header const consumes: string[] = [ {{#consumes}} '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} {{/consumes}} ]; +{{/bodyParam}} +{{#hasFormParams}} +{{^bodyParam}} + // to determine the Content-Type header + const consumes: string[] = [ + {{#consumes}} + '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} + {{/consumes}} + ]; +{{/bodyParam}} +{{/hasFormParams}} {{#bodyParam}} const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/encoder.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/encoder.mustache index b3685b0bd92..c7e5f3cc8da 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/encoder.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/encoder.mustache @@ -7,9 +7,9 @@ import { QueryEncoder } from '@angular/http'; {{#useHttpClient}} /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); @@ -27,10 +27,10 @@ export class CustomHttpParameterCodec implements HttpParameterCodec { {{/useHttpClient}} {{^useHttpClient}} /** -* Custom QueryEncoder -* Fix plus sign (+) not encoding, so sent as blank space -* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 -*/ + * Custom QueryEncoder + * Fix plus sign (+) not encoding, so sent as blank space + * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 + */ export class CustomQueryEncoderHelper extends QueryEncoder { encodeKey(k: string): string { k = super.encodeKey(k); diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index ff2ed68baa6..62bfcb0f689 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -196,7 +196,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store */ @@ -223,6 +222,7 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -249,7 +249,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey @@ -280,9 +279,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -333,9 +329,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -387,9 +380,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -433,9 +423,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -452,7 +439,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store */ @@ -479,6 +465,7 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -505,7 +492,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -577,7 +563,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index e774b1f93ac..31b3c704691 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -144,9 +131,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -184,9 +168,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -224,9 +205,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -243,7 +221,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet */ @@ -264,6 +241,7 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index a1ab3ad5952..42bac67fac3 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * This can only be done by the logged in user. @@ -210,6 +197,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -234,7 +222,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -253,6 +240,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -277,7 +265,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -296,6 +283,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -339,9 +327,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -358,7 +343,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -379,9 +363,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -398,7 +379,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text @@ -431,9 +411,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -451,7 +428,6 @@ export class UserService { /** * Logs out current logged in user session - * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -466,9 +442,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -508,6 +481,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v2/default/encoder.ts b/samples/client/petstore/typescript-angular-v2/default/encoder.ts index 2a26942bee0..a0221503f9c 100644 --- a/samples/client/petstore/typescript-angular-v2/default/encoder.ts +++ b/samples/client/petstore/typescript-angular-v2/default/encoder.ts @@ -1,10 +1,10 @@ import { QueryEncoder } from '@angular/http'; /** -* Custom QueryEncoder -* Fix plus sign (+) not encoding, so sent as blank space -* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 -*/ + * Custom QueryEncoder + * Fix plus sign (+) not encoding, so sent as blank space + * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 + */ export class CustomQueryEncoderHelper extends QueryEncoder { encodeKey(k: string): string { k = super.encodeKey(k); diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index ff2ed68baa6..62bfcb0f689 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -196,7 +196,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store */ @@ -223,6 +222,7 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -249,7 +249,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey @@ -280,9 +279,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -333,9 +329,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -387,9 +380,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -433,9 +423,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -452,7 +439,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store */ @@ -479,6 +465,7 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -505,7 +492,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -577,7 +563,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index e774b1f93ac..31b3c704691 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -144,9 +131,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -184,9 +168,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -224,9 +205,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -243,7 +221,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet */ @@ -264,6 +241,7 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index a1ab3ad5952..42bac67fac3 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * This can only be done by the logged in user. @@ -210,6 +197,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -234,7 +222,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -253,6 +240,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -277,7 +265,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -296,6 +283,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -339,9 +327,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -358,7 +343,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -379,9 +363,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -398,7 +379,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text @@ -431,9 +411,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -451,7 +428,6 @@ export class UserService { /** * Logs out current logged in user session - * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -466,9 +442,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -508,6 +481,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v2/npm/encoder.ts b/samples/client/petstore/typescript-angular-v2/npm/encoder.ts index 2a26942bee0..a0221503f9c 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/encoder.ts @@ -1,10 +1,10 @@ import { QueryEncoder } from '@angular/http'; /** -* Custom QueryEncoder -* Fix plus sign (+) not encoding, so sent as blank space -* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 -*/ + * Custom QueryEncoder + * Fix plus sign (+) not encoding, so sent as blank space + * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 + */ export class CustomQueryEncoderHelper extends QueryEncoder { encodeKey(k: string): string { k = super.encodeKey(k); diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index 5f26d9ad2b8..7aebfe5fef4 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -197,7 +197,6 @@ export class PetService implements PetServiceInterface { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store */ @@ -224,6 +223,7 @@ export class PetService implements PetServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -250,7 +250,6 @@ export class PetService implements PetServiceInterface { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey @@ -281,9 +280,6 @@ export class PetService implements PetServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -334,9 +330,6 @@ export class PetService implements PetServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -388,9 +381,6 @@ export class PetService implements PetServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -434,9 +424,6 @@ export class PetService implements PetServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -453,7 +440,6 @@ export class PetService implements PetServiceInterface { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store */ @@ -480,6 +466,7 @@ export class PetService implements PetServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -506,7 +493,6 @@ export class PetService implements PetServiceInterface { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -578,7 +564,6 @@ export class PetService implements PetServiceInterface { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index f048d9575ec..7fdd6d03883 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -46,19 +46,6 @@ export class StoreService implements StoreServiceInterface { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -145,9 +132,6 @@ export class StoreService implements StoreServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -185,9 +169,6 @@ export class StoreService implements StoreServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -225,9 +206,6 @@ export class StoreService implements StoreServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -244,7 +222,6 @@ export class StoreService implements StoreServiceInterface { /** * Place an order for a pet - * * @param body order placed for purchasing the pet */ @@ -265,6 +242,7 @@ export class StoreService implements StoreServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index d89810de1ea..d852fae20a1 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -46,19 +46,6 @@ export class UserService implements UserServiceInterface { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * This can only be done by the logged in user. @@ -211,6 +198,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -235,7 +223,6 @@ export class UserService implements UserServiceInterface { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -254,6 +241,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -278,7 +266,6 @@ export class UserService implements UserServiceInterface { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -297,6 +284,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -340,9 +328,6 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -359,7 +344,6 @@ export class UserService implements UserServiceInterface { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -380,9 +364,6 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -399,7 +380,6 @@ export class UserService implements UserServiceInterface { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text @@ -432,9 +412,6 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -452,7 +429,6 @@ export class UserService implements UserServiceInterface { /** * Logs out current logged in user session - * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -467,9 +443,6 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -509,6 +482,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/encoder.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/encoder.ts index 2a26942bee0..a0221503f9c 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/encoder.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/encoder.ts @@ -1,10 +1,10 @@ import { QueryEncoder } from '@angular/http'; /** -* Custom QueryEncoder -* Fix plus sign (+) not encoding, so sent as blank space -* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 -*/ + * Custom QueryEncoder + * Fix plus sign (+) not encoding, so sent as blank space + * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 + */ export class CustomQueryEncoderHelper extends QueryEncoder { encodeKey(k: string): string { k = super.encodeKey(k); 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 5cd7568a7b0..52f9e5ee8d9 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 @@ -61,7 +61,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -92,6 +91,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -115,7 +115,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -150,9 +149,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -204,9 +200,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -259,9 +252,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -306,9 +296,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -322,7 +309,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -353,6 +339,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -376,7 +363,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -445,7 +431,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload 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 7f97217dc14..d853a0f4c88 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 @@ -43,19 +43,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,9 +70,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -124,9 +108,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -165,9 +146,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -181,7 +159,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -206,6 +183,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; 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 34379e25ae6..b8f2a9f32d9 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 @@ -43,19 +43,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,6 +70,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -104,7 +92,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -127,6 +114,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -148,7 +136,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -171,6 +158,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -215,9 +203,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -231,7 +216,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -256,9 +240,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -272,7 +253,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -309,9 +289,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -326,7 +303,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -345,9 +321,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -388,6 +361,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts b/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index ff2ed68baa6..62bfcb0f689 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -196,7 +196,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store */ @@ -223,6 +222,7 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -249,7 +249,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey @@ -280,9 +279,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -333,9 +329,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -387,9 +380,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -433,9 +423,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -452,7 +439,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store */ @@ -479,6 +465,7 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -505,7 +492,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -577,7 +563,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index e774b1f93ac..31b3c704691 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -144,9 +131,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -184,9 +168,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -224,9 +205,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -243,7 +221,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet */ @@ -264,6 +241,7 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index a1ab3ad5952..42bac67fac3 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * This can only be done by the logged in user. @@ -210,6 +197,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -234,7 +222,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -253,6 +240,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -277,7 +265,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -296,6 +283,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -339,9 +327,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -358,7 +343,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -379,9 +363,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -398,7 +379,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text @@ -431,9 +411,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -451,7 +428,6 @@ export class UserService { /** * Logs out current logged in user session - * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -466,9 +442,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -508,6 +481,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v4/npm/encoder.ts b/samples/client/petstore/typescript-angular-v4/npm/encoder.ts index 2a26942bee0..a0221503f9c 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/encoder.ts @@ -1,10 +1,10 @@ import { QueryEncoder } from '@angular/http'; /** -* Custom QueryEncoder -* Fix plus sign (+) not encoding, so sent as blank space -* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 -*/ + * Custom QueryEncoder + * Fix plus sign (+) not encoding, so sent as blank space + * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 + */ export class CustomQueryEncoderHelper extends QueryEncoder { encodeKey(k: string): string { k = super.encodeKey(k); diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index d7085113ed4..989d91b5c02 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -61,7 +61,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -92,6 +91,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -115,7 +115,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -150,9 +149,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -204,9 +200,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -259,9 +252,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -306,9 +296,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -322,7 +309,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -353,6 +339,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -376,7 +363,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -445,7 +431,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts index 04d518a1495..97392be5f22 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts @@ -43,19 +43,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,9 +70,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -124,9 +108,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -165,9 +146,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -181,7 +159,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -206,6 +183,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts index 446f5c51c27..5357ddadaa8 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts @@ -43,19 +43,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,6 +70,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -104,7 +92,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -127,6 +114,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -148,7 +136,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -171,6 +158,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -215,9 +203,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -231,7 +216,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -256,9 +240,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -272,7 +253,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -309,9 +289,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -326,7 +303,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -345,9 +321,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -388,6 +361,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/encoder.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index d7085113ed4..989d91b5c02 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -61,7 +61,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -92,6 +91,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -115,7 +115,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -150,9 +149,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -204,9 +200,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -259,9 +252,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -306,9 +296,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -322,7 +309,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -353,6 +339,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -376,7 +363,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -445,7 +431,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts index 04d518a1495..97392be5f22 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -43,19 +43,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,9 +70,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -124,9 +108,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -165,9 +146,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -181,7 +159,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -206,6 +183,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts index 446f5c51c27..5357ddadaa8 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -43,19 +43,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,6 +70,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -104,7 +92,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -127,6 +114,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -148,7 +136,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -171,6 +158,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -215,9 +203,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -231,7 +216,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -256,9 +240,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -272,7 +253,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -309,9 +289,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -326,7 +303,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -345,9 +321,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -388,6 +361,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index de386b6ee40..a0df069e6a4 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -63,7 +63,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -94,6 +93,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -117,7 +117,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -152,9 +151,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -206,9 +202,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -261,9 +254,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -308,9 +298,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -324,7 +311,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -355,6 +341,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -378,7 +365,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -447,7 +433,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts index 2fa5e819b06..6264d975e00 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,9 +72,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -126,9 +110,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -167,9 +148,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -183,7 +161,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -208,6 +185,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts index c86088f8a6a..a85d8564995 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,6 +72,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -106,7 +94,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -129,6 +116,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -150,7 +138,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -173,6 +160,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -217,9 +205,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -233,7 +218,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -258,9 +242,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -274,7 +255,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -311,9 +291,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -328,7 +305,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -347,9 +323,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -390,6 +363,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/encoder.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index de386b6ee40..a0df069e6a4 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -63,7 +63,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -94,6 +93,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -117,7 +117,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -152,9 +151,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -206,9 +202,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -261,9 +254,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -308,9 +298,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -324,7 +311,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -355,6 +341,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -378,7 +365,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -447,7 +433,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts index 2fa5e819b06..6264d975e00 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,9 +72,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -126,9 +110,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -167,9 +148,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -183,7 +161,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -208,6 +185,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts index c86088f8a6a..a85d8564995 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,6 +72,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -106,7 +94,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -129,6 +116,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -150,7 +138,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -173,6 +160,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -217,9 +205,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -233,7 +218,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -258,9 +242,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -274,7 +255,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -311,9 +291,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -328,7 +305,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -347,9 +323,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -390,6 +363,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index d7085113ed4..989d91b5c02 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -61,7 +61,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -92,6 +91,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -115,7 +115,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -150,9 +149,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -204,9 +200,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -259,9 +252,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -306,9 +296,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -322,7 +309,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -353,6 +339,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -376,7 +363,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -445,7 +431,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts index 04d518a1495..97392be5f22 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts @@ -43,19 +43,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,9 +70,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -124,9 +108,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -165,9 +146,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -181,7 +159,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -206,6 +183,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts index 446f5c51c27..5357ddadaa8 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts @@ -43,19 +43,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,6 +70,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -104,7 +92,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -127,6 +114,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -148,7 +136,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -171,6 +158,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -215,9 +203,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -231,7 +216,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -256,9 +240,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -272,7 +253,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -309,9 +289,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -326,7 +303,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -345,9 +321,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -388,6 +361,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/encoder.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index d7085113ed4..989d91b5c02 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -61,7 +61,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -92,6 +91,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -115,7 +115,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -150,9 +149,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -204,9 +200,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -259,9 +252,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -306,9 +296,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -322,7 +309,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -353,6 +339,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -376,7 +363,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -445,7 +431,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts index 04d518a1495..97392be5f22 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -43,19 +43,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,9 +70,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -124,9 +108,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -165,9 +146,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -181,7 +159,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -206,6 +183,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts index 446f5c51c27..5357ddadaa8 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -43,19 +43,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,6 +70,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -104,7 +92,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -127,6 +114,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -148,7 +136,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -171,6 +158,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -215,9 +203,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -231,7 +216,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -256,9 +240,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -272,7 +253,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -309,9 +289,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -326,7 +303,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -345,9 +321,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -388,6 +361,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index de386b6ee40..a0df069e6a4 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -63,7 +63,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -94,6 +93,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -117,7 +117,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -152,9 +151,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -206,9 +202,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -261,9 +254,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -308,9 +298,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -324,7 +311,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -355,6 +341,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -378,7 +365,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -447,7 +433,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts index 2fa5e819b06..6264d975e00 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,9 +72,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -126,9 +110,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -167,9 +148,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -183,7 +161,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -208,6 +185,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts index c86088f8a6a..a85d8564995 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,6 +72,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -106,7 +94,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -129,6 +116,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -150,7 +138,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -173,6 +160,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -217,9 +205,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -233,7 +218,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -258,9 +242,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -274,7 +255,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -311,9 +291,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -328,7 +305,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -347,9 +323,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -390,6 +363,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/encoder.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index de386b6ee40..a0df069e6a4 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -63,7 +63,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -94,6 +93,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -117,7 +117,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -152,9 +151,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -206,9 +202,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -261,9 +254,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -308,9 +298,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -324,7 +311,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -355,6 +341,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -378,7 +365,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -447,7 +433,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts index 2fa5e819b06..6264d975e00 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,9 +72,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -126,9 +110,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -167,9 +148,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -183,7 +161,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -208,6 +185,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts index c86088f8a6a..a85d8564995 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,6 +72,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -106,7 +94,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -129,6 +116,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -150,7 +138,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -173,6 +160,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -217,9 +205,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -233,7 +218,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -258,9 +242,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -274,7 +255,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -311,9 +291,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -328,7 +305,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -347,9 +323,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -390,6 +363,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k);