API versioning

If third-party clients use your API, you could consider versioning your API to avoid breaking changes when you update your application.

Versioning an API is often a matter of making a set of stable resources available under subdomains. For instance, GitLab maintains three versions of its API. They are accessible under https://example/api/v3, and so on. Like a lot of architectural decisions in software, versioning is a tradeoff.

It will require more work to design such an API and identify breaking changes in the API. Often, the addition of new fields will not be as problematic as removing or transforming the API entity results or requests.

Most of the time, you will be in charge of both the API and the client, thereby removing the need ...

Get Spring MVC: Designing Real-World Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.