Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

API Versioning in .NET Core


Published on

This talk, from a live event for dotnetsheff, is about how to do versioning in .NET Core.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

API Versioning in .NET Core

  1. 1. Shawn Wildermuth Microsoft MVP, Author, and Speaker @shawnwildermuth Versioning APIs with ASP.NET Core Shawn Wildermuth Microsoft MVP, Speaker and Filmmaker
  2. 2. Who Am I? Author, Instructor, Coach Pluralsight Author > 20 Courses to my name Wilder Minds Training Courses on Vue, Bootstrap 4 & Font Awesome Making a Film Hello World Film
  3. 3. What Is API Versioning? Once you publish, It’s Set in Stone Users rely on the API not changing But requirements will change Evolve the API without breaking clients API Versioning isn't Product Versioning Don't tie them together
  4. 4. The Problem with API Versioning In typical projects Versioning is accomplished with different versions of the package E.g. Assemblies API versioning is harder Your API needs to support both new and old users Side-by-side deployment isn't feasible most of the time Need to support both versions in same code base
  5. 5. API Versioning Schemes There are lots of ways to version an API Not all of them are recommended If you find a mechanism that works for you that’s all that matters But remember that you’re serving your clients, not yourselves
  6. 6. Versioning in the URI // URI Path // Query String
  7. 7. Versioning with Headers GET /api/camps HTTP/1.1 Host: localhost:44388 Content-Type: application/json X-Version: 2.0
  8. 8. Versioning with Accept Header GET /api/camps HTTP/1.1 Host: localhost:44388 Content-Type: application/json Accept: application/json;version=2.0
  9. 9. Versioning with Content Type GET /api/camps HTTP/1.1 Host: localhost:44388 Content-Type: application/ Accept: application/
  10. 10. Demo API Versioning
  11. 11. Q&A
  12. 12. Takeaways Get It: My Blog (for this demo):