- 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
推薦閱讀
- 微服務設計(第2版)
- UNIX編程藝術
- Learning Neo4j
- Oracle Exadata性能優化
- Java EE 6 企業級應用開發教程
- 數據結構簡明教程(第2版)微課版
- Python進階編程:編寫更高效、優雅的Python代碼
- Java Web開發技術教程
- INSTANT Mercurial SCM Essentials How-to
- Python貝葉斯分析(第2版)
- SharePoint Development with the SharePoint Framework
- Flutter跨平臺開發入門與實戰
- Arduino機器人系統設計及開發
- Offer來了:Java面試核心知識點精講(框架篇)
- Blender 3D Cookbook