- Building Microservices with Go
- Nic Jackson
- 173字
- 2021-07-15 17:28:15
Versioning APIs
API versioning is something you should think about from the very beginning and avoid as long as you can. In general, you will need to make changes to your API, however, having to maintain n different versions can be a royal pain in the backside, so doing the upfront design thinking at the beginning can save you a whole load of trouble.
Before we look at how you can version your API, which is quite straightforward let's look at when you should version.
You would increment your API version number when you introduce a breaking change.
Breaking changes include:
- Removing or renaming APIs or API parameters
- Changing the type of an API parameter, for example, from integer to string
- Changes to response codes, error codes, or fault contracts
- Changes to the behavior of an existing API
Things that do not involve a breaking change include:
- Adding parameters to a returned entity
- Adding additional endpoints or functionality
- Bug fixes or other maintenance that does not include items in the breaking changes list
推薦閱讀
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- Visual C++程序設計教程
- 微信公眾平臺與小程序開發:從零搭建整套系統
- LabVIEW 2018 虛擬儀器程序設計
- Visual Studio 2012 Cookbook
- Three.js開發指南:基于WebGL和HTML5在網頁上渲染3D圖形和動畫(原書第3版)
- Scratch 3.0少兒編程與邏輯思維訓練
- JavaScript動態網頁開發詳解
- Python時間序列預測
- C/C++程序員面試指南
- 移動互聯網軟件開發實驗指導
- HoloLens與混合現實開發
- Python:Deeper Insights into Machine Learning
- Python函數式編程(第2版)
- 深入淺出 HTTPS:從原理到實戰