swagger-api / swagger-api/swagger-client
applySecurities fails as securityDef is returned as undefined.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 765
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 6
Description
securityDef is returning undefined because get function is not able to look through nested object. Although the spec included the security definition get functioned failed to look for securitySchemes key.
https://github.com/swagger-api/swagger-js/blob/e0003d0d29a561a36c01004a3b65bdae5bc56b84/src/execute/oas3/build-request.js#L94
This is probably because the webpack config doesn't enable the Deep property path support for methods like _.get, _.has, & _.set. feature set
I was using https://swaggerapis.rainmaker.espressif.com/ API which involves getting an AccessToken(apiKey) after sending a login request. All rest of the authorised API calls used this token for verification. Whenever I made a request, securityDef would be undefined and API call would not execute.
I highly suspect the fix is just to add the above feature set to the loadlash module.
Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/execute/oas3/build-request.js around line 94 and inspect how the security definition is retrieved, then review the webpack configuration and its lodash feature support. Reproduce the request against the described API and confirm that nested securitySchemes resolution produces a security definition and allows the authorized call to execute.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, webpack
- Domain
- api, authentication, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100