Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [typescript] Duplicate parameter's names (rename options to _options and config to _config) #9428

Merged
merged 2 commits into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
* @param {{paramName}} {{description}}
{{/allParams}}
*/
public async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;
{{#allParams}}

{{#required}}
Expand All @@ -57,7 +57,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.{{httpMethod}});
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.{{httpMethod}});
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand Down Expand Up @@ -132,7 +132,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
{{/hasAuthMethods}}
// Apply auth methods
{{#authMethods}}
authMethod = config.authMethods["{{name}}"]
authMethod = _config.authMethods["{{name}}"]
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export class Observable{{classname}} {
* @param {{paramName}} {{description}}
{{/allParams}}
*/
public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
const requestContextPromise = this.requestFactory.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options);
public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
const requestContextPromise = this.requestFactory.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}_options);

// build promise chain
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export class Promise{{classname}} {
* @param {{paramName}} {{description}}
{{/allParams}}
*/
public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
const result = this.api.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options);
public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
const result = this.api.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}_options);
return result.toPromise();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
* Add a new pet to the store
* @param pet Pet object that needs to be added to the store
*/
public async addPet(pet: Pet, options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async addPet(pet: Pet, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// verify required parameter 'pet' is not null or undefined
if (pet === null || pet === undefined) {
Expand All @@ -32,7 +32,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
const localVarPath = '/pet';

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand All @@ -57,7 +57,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {

let authMethod = null;
// Apply auth methods
authMethod = config.authMethods["petstore_auth"]
authMethod = _config.authMethods["petstore_auth"]
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}
Expand All @@ -70,8 +70,8 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
* @param petId Pet id to delete
* @param apiKey
*/
public async deletePet(petId: number, apiKey?: string, options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// verify required parameter 'petId' is not null or undefined
if (petId === null || petId === undefined) {
Expand All @@ -85,7 +85,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand All @@ -100,7 +100,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {

let authMethod = null;
// Apply auth methods
authMethod = config.authMethods["petstore_auth"]
authMethod = _config.authMethods["petstore_auth"]
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}
Expand All @@ -113,8 +113,8 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
* Finds Pets by status
* @param status Status values that need to be considered for filter
*/
public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// verify required parameter 'status' is not null or undefined
if (status === null || status === undefined) {
Expand All @@ -126,7 +126,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
const localVarPath = '/pet/findByStatus';

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand All @@ -143,7 +143,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {

let authMethod = null;
// Apply auth methods
authMethod = config.authMethods["petstore_auth"]
authMethod = _config.authMethods["petstore_auth"]
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}
Expand All @@ -156,8 +156,8 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
* Finds Pets by tags
* @param tags Tags to filter by
*/
public async findPetsByTags(tags: Array<string>, options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async findPetsByTags(tags: Array<string>, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// verify required parameter 'tags' is not null or undefined
if (tags === null || tags === undefined) {
Expand All @@ -169,7 +169,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
const localVarPath = '/pet/findByTags';

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand All @@ -186,7 +186,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {

let authMethod = null;
// Apply auth methods
authMethod = config.authMethods["petstore_auth"]
authMethod = _config.authMethods["petstore_auth"]
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}
Expand All @@ -199,8 +199,8 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
* Find pet by ID
* @param petId ID of pet to return
*/
public async getPetById(petId: number, options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async getPetById(petId: number, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// verify required parameter 'petId' is not null or undefined
if (petId === null || petId === undefined) {
Expand All @@ -213,7 +213,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand All @@ -227,7 +227,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {

let authMethod = null;
// Apply auth methods
authMethod = config.authMethods["api_key"]
authMethod = _config.authMethods["api_key"]
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}
Expand All @@ -239,8 +239,8 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
* Update an existing pet
* @param pet Pet object that needs to be added to the store
*/
public async updatePet(pet: Pet, options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async updatePet(pet: Pet, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// verify required parameter 'pet' is not null or undefined
if (pet === null || pet === undefined) {
Expand All @@ -252,7 +252,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
const localVarPath = '/pet';

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand All @@ -277,7 +277,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {

let authMethod = null;
// Apply auth methods
authMethod = config.authMethods["petstore_auth"]
authMethod = _config.authMethods["petstore_auth"]
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}
Expand All @@ -291,8 +291,8 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
* @param name Updated name of the pet
* @param status Updated status of the pet
*/
public async updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// verify required parameter 'petId' is not null or undefined
if (petId === null || petId === undefined) {
Expand All @@ -307,7 +307,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand All @@ -331,7 +331,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {

let authMethod = null;
// Apply auth methods
authMethod = config.authMethods["petstore_auth"]
authMethod = _config.authMethods["petstore_auth"]
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}
Expand All @@ -345,8 +345,8 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
*/
public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// verify required parameter 'petId' is not null or undefined
if (petId === null || petId === undefined) {
Expand All @@ -361,7 +361,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand All @@ -385,7 +385,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {

let authMethod = null;
// Apply auth methods
authMethod = config.authMethods["petstore_auth"]
authMethod = _config.authMethods["petstore_auth"]
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
* Delete purchase order by ID
* @param orderId ID of the order that needs to be deleted
*/
public async deleteOrder(orderId: string, options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async deleteOrder(orderId: string, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// verify required parameter 'orderId' is not null or undefined
if (orderId === null || orderId === undefined) {
Expand All @@ -33,7 +33,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand All @@ -54,14 +54,14 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
* Returns a map of status codes to quantities
* Returns pet inventories by status
*/
public async getInventory(options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async getInventory(_options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// Path Params
const localVarPath = '/store/inventory';

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand All @@ -75,7 +75,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {

let authMethod = null;
// Apply auth methods
authMethod = config.authMethods["api_key"]
authMethod = _config.authMethods["api_key"]
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}
Expand All @@ -88,8 +88,8 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
* Find purchase order by ID
* @param orderId ID of pet that needs to be fetched
*/
public async getOrderById(orderId: number, options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async getOrderById(orderId: number, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// verify required parameter 'orderId' is not null or undefined
if (orderId === null || orderId === undefined) {
Expand All @@ -102,7 +102,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand All @@ -123,8 +123,8 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
* Place an order for a pet
* @param order order placed for purchasing the pet
*/
public async placeOrder(order: Order, options?: Configuration): Promise<RequestContext> {
let config = options || this.configuration;
public async placeOrder(order: Order, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// verify required parameter 'order' is not null or undefined
if (order === null || order === undefined) {
Expand All @@ -136,7 +136,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
const localVarPath = '/store/order';

// Make Request Context
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Query Params
Expand Down
Loading