Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #1374 Generator missing standard parameters #1390

Merged
merged 2 commits into from Oct 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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