swagger icon indicating copy to clipboard operation
swagger copied to clipboard

feature(document-builder): improved types of security scheme methods

Open xTCry opened this issue 3 years ago • 5 comments

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

xTCry avatar Sep 01 '22 10:09 xTCry

@micalevisk, can you please review this PR

xTCry avatar Oct 07 '22 17:10 xTCry

@kamilmysliwiec, @micalevisk, can you accept this PR?

xTCry avatar Nov 24 '22 01:11 xTCry

@kamilmysliwiec Can this improvement see the light in the next release?

xTCry avatar Mar 17 '23 12:03 xTCry

Good PR

rtkid-nt avatar Apr 01 '23 01:04 rtkid-nt

@micalevisk, types updated

xTCry avatar Feb 27 '24 00:02 xTCry