forked from loafle/openapi-generator-original
Fixed mustache to handle non-required parameters
This commit is contained in:
parent
f6a1af2831
commit
4133cae2bc
@ -22,7 +22,7 @@ module {{package}} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
public {{nickname}} ({{#allParams}}{{paramName}}: {{{dataType}}}, {{/allParams}} extraHttpRequestParams?: any ) : ng.IHttpPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> {
|
public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any ) : ng.IHttpPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> {
|
||||||
var path = this.basePath + '{{path}}';
|
var path = this.basePath + '{{path}}';
|
||||||
{{#pathParams}}
|
{{#pathParams}}
|
||||||
path = path.replace('{' + '{{paramName}}' + '}', String({{paramName}}));
|
path = path.replace('{' + '{{paramName}}' + '}', String({{paramName}}));
|
||||||
@ -50,7 +50,7 @@ module {{package}} {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ export class {{classname}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
public {{nickname}} ({{#allParams}}{{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}} ) : Promise<{ response: http.ClientResponse; {{#returnType}}body: {{{returnType}}}; {{/returnType}} }> {
|
public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : Promise<{ response: http.ClientResponse; {{#returnType}}body: {{{returnType}}}; {{/returnType}} }> {
|
||||||
var path = this.url + this.basePath + '{{path}}';
|
var path = this.url + this.basePath + '{{path}}';
|
||||||
|
|
||||||
{{#pathParams}}
|
{{#pathParams}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user