Skip to content

Commit

Permalink
fix: generator missing standard parameters (#1390)
Browse files Browse the repository at this point in the history
resolves #1374
  • Loading branch information
ajaaym authored and JustinBeckwith committed Oct 17, 2018
1 parent cf9b104 commit 16b912b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/generator/templates/api-endpoint.njk
Expand Up @@ -83,6 +83,15 @@ export class {{ Name }} {
return this.root;
}

interface StandardParameters {
{% for pname, p in api.parameters|dictsort %}
/**
* {{ p.description|oneLine|cleanComments|safe }}
*/
{{ pname|getSafeParamName }}?: {{ p.type }};
{% endfor %}
}

{% if api.methods %}
{% for mname, m in api.methods|dictsort %}
{{ method.render(m, mname, api, api) }}
Expand Down Expand Up @@ -121,7 +130,7 @@ export interface Schema${{ schema.id }} {

{% if api.methods %}
{% for mname, m in api.methods|dictsort %}
export interface Params$${{ mname|capitalize }} {
export interface Params$${{ mname|capitalize }} extends StandardParameters {

/**
* Auth client or API Key for the request
Expand Down
2 changes: 1 addition & 1 deletion src/generator/templates/resource-partial.njk
Expand Up @@ -36,7 +36,7 @@

{% if r.methods %}
{% for mname, m in r.methods|dictsort %}
export interface Params${{ClassName}}${{ mname|capitalize }} {
export interface Params${{ClassName}}${{ mname|capitalize }} extends StandardParameters {
/**
* Auth client or API Key for the request
*/
Expand Down

0 comments on commit 16b912b

Please sign in to comment.