Versioning

A REST API is a collection of interlinked resources or resource models. The representational resources communicate their state through the versions. So versioning is one of the essential design principles, and we will look at the versioning of APIs before we state the rules for versioning.

APIs should be versioned (increase the major version) when it undergoes a breaking change; breaking changes include the following:

  • Response data changes
  • Response type changes
  • Removing any part of the API

APIs should undergo version changes even when it involves minor or non-breaking modifications, such as adding new endpoints or new response parameters. Minor versions help to track the APIs' small changes and assist in customer support, who may be receiving cached versions of data or may be experiencing other API issues. Following are a few of the rules about REST API versioning:

  • Use new URIs to introduce new models or conceptions
  • Use schemas for managing representational form versions
  • Make use of ETags to manage representational state versions
The general versioning practices follow schematic versioning (https://semver.org/); however, the versioning practices in RESTful API attract lots of discussions, and please be aware that, as API designers, we may need to make decisions aligned with business needs and impacts. 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.61.30