Fixed headerParams and paramName

This commit is contained in:
Martin Hardorf 2015-06-23 12:05:43 +02:00
parent 449ba4f644
commit c45af23946
2 changed files with 6 additions and 6 deletions

View File

@ -22,13 +22,13 @@ module {{package}} {
}
}
{{#operation}}
public {{nickname}} ({{#allParams}}{{paramName}}: {{{dataType}}}, {{/allParams}} extraHttpRequestParams?: any ) : ng.IHttpPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> {
public {{nickname}} ({{#allParams}}{{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}} {{/allParams}} extraHttpRequestParams?: any ) : ng.IHttpPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> {
var path = this.basePath + '{{path}}';
{{#pathParams}}
path = path.replace('{' + '{{paramName}}' + '}', String({{paramName}}));
{{/pathParams}}
var queryParameters: any = {};
var headers: any = {};
var headerParams: any = {};
{{#allParams}}{{#required}}
// verify required parameter '{{paramName}}' is set
if (!{{paramName}}) {
@ -43,10 +43,10 @@ module {{package}} {
method: '{{httpMethod}}',
url: path,
json: true,
{{#bodyParam}}data: body,
{{#bodyParam}}data: {{paramName}},
{{/bodyParam}}
params: queryParameters,
headers: headers
headers: headerParams
};
if (extraHttpRequestParams) {

View File

@ -24,7 +24,7 @@ export class {{classname}} {
{{/pathParams}}
var queryParameters: any = {};
var headers: any = {};
var headerParams: any = {};
{{#allParams}}{{#required}}
// verify required parameter '{{paramName}}' is set
@ -48,7 +48,7 @@ export class {{classname}} {
qs: queryParameters,
uri: path,
json: true,
{{#bodyParam}}body: body,
{{#bodyParam}}body: {{paramName}},
{{/bodyParam}}
auth: {
username: this.username, password: this.password