Skip to content

Best way to implement versioning? #984

Answered by AArnott
SR84 asked this question in Q&A
Discussion options

You must be logged in to vote

I don't know how WebApi projects do their versioning. But at a high level, I'd say you have two strategies to consider:

  1. Avoid breaking changes by adding new methods without altering or removing existing ones. Note that in .NET adding members to an interface is a breaking change, but across JSON-RPC, it is not a breaking change to add methods to an interface.
  2. Fork your service, and expose it at two endpoints. One endpoint exposes the old API and the second endpoint exposes the new one. The endpoints might be at two unique URLs, or they could be at the same URL but differentiate by HTTP header. Or if URL doesn't apply, you could change the port number on the new endpoint.
    The most advanced…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SR84
Comment options

Answer selected by SR84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants