- 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
推薦閱讀
- Spring Boot開發與測試實戰
- Java面向對象思想與程序設計
- Wireshark Network Security
- Windows Forensics Cookbook
- Teaching with Google Classroom
- C# 8.0核心技術指南(原書第8版)
- Java編程從入門到精通
- 軟件工程與UML案例解析(第三版)
- Microsoft HoloLens By Example
- 從“1”開始3D編程
- 關系數據庫與SQL Server 2012(第3版)
- 區塊鏈原理、架構與應用(第2版)
- R Data Visualization Cookbook
- Learning PowerShell DSC(Second Edition)
- PHP程序員面試算法寶典