You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating a typescript-angular client a queryParameters parameter is generated which is not defined if endpoint has no parameters but apiKeyQuery is set within securityDefinitions.
It seems that the {{#hasQueryParams}} in the api.service.mustache file does not respect the apiKeyQuery
generate the client with above command. See default.service.ts:78 where a variable queryParameters is used which is not defined.
Related issues/PRs
Suggest a fix/enhancement
respect apiKeyQuery for the {{#hasQueryParams}} in api.service.mustache
The text was updated successfully, but these errors were encountered:
jwoehrle
changed the title
undefined queryParameters when apiKeyQuery but not method parameters
undefined queryParameters when apiKeyQuery exists but no method parameters
Jan 3, 2018
jwoehrle
changed the title
undefined queryParameters when apiKeyQuery exists but no method parameters
[typescript-angular] undefined queryParameters when apiKeyQuery exists but no method parameters
Jan 4, 2018
AsamK
pushed a commit
to AsamK/swagger-codegen
that referenced
this issue
Jun 7, 2018
Description
I stumpled upon this issue when trying to generate a client for the Microsoft LUIS API. The complete swagger file can be found at https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/export?DocumentFormat=Swagger&ApiName=LUIS%20Programmatic%20APIs%20v2.0 however see below for a smaller file which illustrates the issue as well.
When generating a typescript-angular client a queryParameters parameter is generated which is not defined if endpoint has no parameters but
apiKeyQuery
is set withinsecurityDefinitions
.It seems that the
{{#hasQueryParams}}
in theapi.service.mustache
file does not respect theapiKeyQuery
Swagger-codegen version
2.3.0
Swagger declaration file content or url
Config file
Command line used for generation
java -jar swagger-codegen-cli-2.3.0.jar generate -i "C:\tmp\swagger_example.json" -l typescript-angular -o ./angular_client -DnpmName=LUIS_CLIENT -c config.json
Steps to reproduce
generate the client with above command. See
default.service.ts:78
where a variablequeryParameters
is used which is not defined.Related issues/PRs
Suggest a fix/enhancement
respect
apiKeyQuery
for the{{#hasQueryParams}}
inapi.service.mustache
The text was updated successfully, but these errors were encountered: