Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
default when optional params and fix types
  • Loading branch information
davidgamero committed Jan 14, 2022
commit b2cb75ea2c388f664152a2fe905f4450cfa653d1
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
{{/bodyParam}}

{{#hasAuthMethods}}
let authMethod = null;
let authMethod: SecurityAuthentication | undefined;
{{/hasAuthMethods}}
{{#authMethods}}
// Apply auth methods
authMethod = defaultSecurityAuthentication || _config.authMethods["{{name}}"]
authMethod = this.defaultSecurityAuthentication || _config.authMethods["{{name}}"]
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export abstract class AbstractObject{{classname}} {
{{/summary}}
* @param param the request object
*/
public abstract {{nickname}}(param: req.{{classname}}{{operationIdCamelCase}}Request, options?: Configuration): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}>;
public abstract {{nickname}}(param: req.{{classname}}{{operationIdCamelCase}}Request {{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}>;

{{/operation}}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class Object{{classname}} {
{{/summary}}
* @param param the request object
*/
public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request, options?: Configuration): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}> {
public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request {{^hasRequiredParams}}= {}{{/hasRequiredParams}}, options?: Configuration): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}> {
return this.api.{{nickname}}({{#allParams}}param.{{paramName}}, {{/allParams}} options){{^useRxJS}}.toPromise(){{/useRxJS}};
}

Expand Down