loading...

REST API versioning with ASP.NET Core

99darshan on January 16, 2020

The best way to version a RESTful API is a topic of constant debate and every other approach have their own pros and cons. There is no 'one size fi... [Read Full]
markdown guide
 

Good post.
Is it possible to use URL path versioning and header API versioning combination? I added URL versioning support to my API but it breaks access to the old URL(api/authors). now I have to specify version in the URL(api/v1.0/authors). but some of the client apps use that old URL. are there any solutions for that?

 

Yes you could use multiple versioning schemes. Supporting multiple versioning Schemes section in this article has an example on how to implement both the query params versioning scheme and request header versioning scheme.

 

That is a great post, in your opinion, what are the best approaches for versioning a REST API?

 

I think it depends on the nature and complexity of the REST API. In the articles, I've laid out the few approaches. For simpler APIs I'd go with either using path param approach or using the request headers.

 
 

Great article!
Thanks so much for this!

 
 

Thanks for sharing this. Never knew there was a version management library within asp net core

 

This is great. It's so nice to see these options baked in instead of having to roll our own support. Thanks for writing this up!

code of conduct - report abuse