swagger icon indicating copy to clipboard operation
swagger copied to clipboard

feat: Add recursiveModuleScan option to scanner

Open hee-c opened this issue 1 year ago • 0 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
  • [x] 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?

The Swagger scanner only scans up to 1-depth for modules included via the include option, even when deepScanRoutes is set to true.

Issue Number: #3102

What is the new behavior?

스크린샷 2024-11-24 오후 2 01 00

When deepScanRoutes is set to true and the newly added recursiveModuleScan flag is also set to true, the modules included via include will be scanned recursively up to the depth defined by maxScanDepth.

  • deepScanRoutes: false: Only scans root modules imported by include (current behavior).
  • deepScanRoutes: true: Scans 1-depth modules imported by include (current behavior).
  • deepScanRoutes: true, recursiveModuleScan: true: Scans all modules recursively, with no depth limit.
  • deepScanRoutes: true, recursiveModuleScan: true, maxScanDepth: 5: Scans modules recursively up to a depth of 5.

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Other information

hee-c avatar Nov 24 '24 04:11 hee-c