feature(document-builder): improved types of security scheme methods
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
- [x] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Other... Please describe:
What is the current behavior?
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
Updated the order of arguments in methods. (Added deprecation for old) https://github.com/nestjs/swagger/pull/1915#discussion_r862519173
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
- [ ] Yes
- [x] No
Other information
@micalevisk, can you please review this PR
@kamilmysliwiec, @micalevisk, can you accept this PR?
@kamilmysliwiec Can this improvement see the light in the next release?
Good PR
@micalevisk, types updated