When to Version a REST API?
When there is a condition or event of breaking change, then it is considered to be best practice to version your API because API versioning is a costly process for both the API users and API developers. A Breaking Change can be defined as a change that may be required to your software applications to avoid abnormal situations of application.
Breaking changes may include:
- When we change a request/response format
- Changing the data type of the resource
- Adding a mandatory/required field on the client HTTP request
- Removing one or more resources on the response
Spring Boot – Versioning a REST API
API Versioning is a defined process of making or managing changes to an API. These changes can be made transparently without interrupting the clients. When users have permission to decide whether they can conveniently upgrade to the latest version of API and clearly state the changes made is known as a Good API Versioning Strategy.