refactor(types): improved security scheme
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [x] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Other... Please describe:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
- [ ] Yes
- [x] No
Other information
@jmcdo29 Yes, I agree. But this is likely to be a breaking change
@xTCry I guess we could keep both and mark the old one as deprecated
What's the reason for this change?
I apologize for the long answer.
What's the reason for this change? @kamilmysliwiec
This is a typing improvement, based on the official Swagger documentation. It is also simplified to access some methods without specifying unnecessary parameters.
For example, why write .addApiKey({ type: 'apiKey'}, 'key1'), if the name of the method speaks for itself that it accepts only the type apiKey.
Also, HttpSchemaObject accepts bearerFormat, OpenIdConnectSchemeObject can use openIdConnectUrl. But they are not used in other ways
Accept this pull request