Conversation
Pull Request Test Coverage Report for Build 052bf0c4-da67-43b3-ba46-c7a94794509bDetails
💛 - Coveralls |
|
This will break packages like |
|
@kamilmysliwiec Thanks for the review! I analyzed the Current behavior with this PR:
Swagger analysis:Swagger uses
This is a functional limitation, not a breaking change - swagger will continue to work, but won't automatically know about additional prefixes. Proposed path forward:
Would this approach work? Or would you prefer a different solution? |
|
@kamilmysliwiec Is there a chance to release it? |
|
|
||
| private get prefixPath(): string { | ||
| return this.prefixPaths[0]; | ||
| } |
There was a problem hiding this comment.
nit: could we move this above the constructor declaration?
|
could you rebase to v12.0.0 branch? |
|
@malkovitc could please rebase with master? |
|
Closing due to inactivity from the author, @malkovitc. The changes have been moved to #17713, rebased onto the current |
PR Checklist
PR Type
What is the current behavior?
Issue Number: #16095
setGlobalPrefix()only accepts a single string prefix. Users who need to expose the same API under multiple base paths (e.g., for different deployment environments) previously used regex-style prefixes like(prefixOne|prefixTwo), which are no longer supported by path-to-regexp v8 in NestJS v11.What is the new behavior?
setGlobalPrefix()now accepts either a string or an array of strings:This provides a migration path for users who previously relied on regex-style prefixes.
Changes:
INestApplication.setGlobalPrefix()interface to acceptstring | string[]getGlobalPrefixes()method toApplicationConfigto retrieve all prefixesRoutePathFactoryto generate paths for each prefix in the arrayRouteInfoPathExtractorto generate middleware paths for all prefixesDoes this PR introduce a breaking change?
The change is backward compatible - existing code using a single string prefix will continue to work.