API versioning allows you to alter behavior based on client's request. There are several way one can implement versioning in the API. In this presentation, all those factors are discussed.
4. When to do API versioning ?
Side by Side deployment not feasible
Need to Support both versions by Code
5. Types of API versioning ?
• URI Path
• Namespace
• Query String
Versioning with URI
• Custom Header
• Accept Header
Versioning with Header
• Content Type
Versioning with ContentType
• Custom Reader/Resolver
Other approach
6. Versioning with URI
Query String:
/api/foo
/api/foo?api-version=1.0
/api/foo?api-version=2.0-Alpha
/api/foo?api-version=2019-02-02
/api/foo?ver=2019-02-02
URI Path:
/api/v1/foo
/api/v2/foo
11. Community Group
Microsoft Azure Bangladesh
• group: www.facebook.com/groups/microsoft.azure.bd
• page: fb.com/microsoft.azure.bd
Asp.Net - Bangladesh
• www.facebook.com/groups/asp.net.mvc.bd
What is api versioning?
When to do versioning?
Different approaches?
In a typical project, versioning is accomplished with diff versions of the package i.e assemblies
ITS NOT Product versioning….
API versioning is harder as you need to support both old and new user
Common misconception: Versioning needs to bake into APIs from the very first day of your project.
Target : Evolve the API without breaking the client
There are lots of way to do versioning…
Query String: MESSY but easy
URI segment :
- Not good for existing project.
- Default api version is not possible
- What if an API don’t have v1 ?
Restful compliance not follow, URI should represent resource, not version!