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 searching for credentials to use for API key authentication, the client searches the configuration object using the name of the header. It is possible for two different security definitions to use the same header name and still provide a valid OpenAPI spec. This behaviour can be problematic when an API provides a set of endpoints that are split between one or the other and the nature of the definitions do not allow interchangeability. The correct key needs to be inserted into the configuration object prior to each request.
👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
djnalluri
changed the title
[BUG][typescript-angular] Security definition collision in lookup
[BUG][typescript-angular] Security definition collision in API key lookup
Jan 21, 2020
Bug Report Checklist
Description
When searching for credentials to use for API key authentication, the client searches the configuration object using the name of the header. It is possible for two different security definitions to use the same header name and still provide a valid OpenAPI spec. This behaviour can be problematic when an API provides a set of endpoints that are split between one or the other and the nature of the definitions do not allow interchangeability. The correct key needs to be inserted into the configuration object prior to each request.
openapi-generator version
4.2.x
OpenAPI declaration file content or url
https://gist.github.com/djnalluri/afbf899e7d730257b2c02a9a157f99de
Command line used for generation
java -jar openapi-generator-cli.jar generate -g typescript-angular -i example.yaml -o example
Steps to reproduce
Use the spec file and command provided above to generate a client.
Related issues/PRs
None for Typescript
Suggest a fix
Since security definitions cannot share a name, I suggest looking up the key using the definition name instead of the header.
When using the provided example, instead of the following code:
this code or similar should be generated:
The text was updated successfully, but these errors were encountered: