Skip to content

Commit

Permalink
Merge pull request #128 from LouisPujol/update-operation-whitespacing
Browse files Browse the repository at this point in the history
Update operation whitespacing
  • Loading branch information
luisfpg authored Nov 23, 2020
2 parents 5a40137 + 253fdbf commit 33be894
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 7 additions & 3 deletions templates/operationParameters.handlebars
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
params{{^operation.parametersRequired}}?{{/operation.parametersRequired}}: {
{{#operation.parameters}}{{tsComments}}{{{var}}}{{^required}}?{{/required}}: {{{type}}};{{#tsComments}}
{{/tsComments}}{{/operation.parameters}}{{#requestBody}} {{{../operation.requestBody.tsComments}}}body{{^../operation.requestBody.required}}?{{/../operation.requestBody.required
}}: {{{type}}}{{/requestBody}}
{{#operation.parameters}}
{{tsComments}}{{{var}}}{{^required}}?{{/required}}: {{{type}}};{{#tsComments}}{{/tsComments}}
{{/operation.parameters}}
{{#requestBody}}
{{{../operation.requestBody.tsComments}}}body{{^../operation.requestBody.required}}?{{/../operation.requestBody.required
}}: {{{type}}}
{{/requestBody}}
}
3 changes: 1 addition & 2 deletions templates/operationResponse.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

const rb = new {{@root.requestBuilderClass}}(this.rootUrl, {{@root.typeName}}.{{operation.pathVar}}, '{{operation.method}}');
if (params) {

{{#operation.parameters}}
rb.{{in}}('{{{name}}}', params{{{varAccess}}}, {{{parameterOptions}}});
{{/operation.parameters}}

{{#requestBody}}
rb.body(params.body, '{{{mediaType}}}');
{{/requestBody}}
}

return this.http.request(rb.build({
responseType: '{{responseType}}',
accept: '{{accept}}'
Expand Down

0 comments on commit 33be894

Please sign in to comment.