Advertisement
Advanced ASP.NET Core, API Versioning

How would you design API versioning strategy differently for a public, third-party-consumed API versus an internal microservice API?

Short answer

Public APIs require conservative, long-lived version support (many months to years), extensive advance deprecation notice, and strict backward-compatibility guarantees since you can't coordinate directly with unknown external consumers.

Save ASP.NET Core mock interview
Advertisement
AModel answer
Public APIs require conservative, long-lived version support (many months to years), extensive advance deprecation notice, and strict backward-compatibility guarantees since you can't coordinate directly with unknown external consumers. Internal microservice APIs, where you control or can coordinate with every consumer, often favor looser versioning (sometimes none at all, relying on coordinated deployments and consumer-driven contract tests) since breaking changes can be communicated and rolled out through direct team coordination rather than needing months of parallel version support.
// Public API: formal versioning, months of overlap
[ApiVersion("1.0", Deprecated = true)]  // still supported 12+ months after v2 launch
[ApiVersion("2.0")]

// Internal API: looser, relies on coordinated deploys + contract tests instead
// often no formal API versioning attributes at all
Real-world example
A company's public partner-facing API maintains three concurrent versions with an 18-month deprecation policy, while their internal order-to-inventory service communication has no formal versioning at all, relying entirely on consumer-driven contract tests run in CI before any deploy.
Likely follow-ups
  • What is consumer-driven contract testing and how does it substitute for formal versioning internally?
  • What risk does an internal API accept by skipping formal versioning?
Related topics