swagger
swagger copied to clipboard
feat: Add recursiveModuleScan option to scanner
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?
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 byinclude(current behavior).deepScanRoutes: true: Scans 1-depth modules imported byinclude(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