NestJS · Senior · Question 51 of 75
How can you implement API versioning without duplicating whole controllers?
- 1Change response formats without versions
- 2Copy the whole app for each version
- ✓Correct answer: Version only changed routes (
@Version), share services, and map to version-specific DTOs at the edges
Explanation
VERSION_NEUTRAL routes serve all versions; only routes whose contract changed need a new version.