swagger icon indicating copy to clipboard operation
swagger copied to clipboard

refactor(types): improved security scheme

Open xTCry opened this issue 3 years ago • 3 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
  • [ ] 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

xTCry avatar May 01 '22 19:05 xTCry

@jmcdo29 Yes, I agree. But this is likely to be a breaking change

xTCry avatar May 01 '22 21:05 xTCry

@xTCry I guess we could keep both and mark the old one as deprecated

micalevisk avatar May 02 '22 01:05 micalevisk

What's the reason for this change?

kamilmysliwiec avatar May 05 '22 07:05 kamilmysliwiec

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

xTCry avatar Sep 01 '22 09:09 xTCry

Accept this pull request

car1ot avatar Oct 15 '22 12:10 car1ot