Versioning

Many books and articles recommend avoiding versioning APIs if possible. However, it's not practical to believe that we'll develop one API that caters to almost every requirement within the first release and never changes, so we avoid versioning altogether. A few others recommend providing different URIs for different (major) version changes. Ideally, we'd manage APIs just like website URLs (most of the time the URL address never changes, regardless of any changes/implementations).

The general rules of thumb we'd like to follow when versioning APIs are as follows:

  • Upgrade the API to a new major version when the new implementation breaks the existing customer implementations
  • Upgrade the API to a new minor version of the API when the new implementation provides enhancements and bug fixes; however, ensure that the implementation takes care of backward-compatibility and has no impact on the existing customer implementations

Let's consider that we need to manage the versions in our API; there are four different ways that we can implement the versioning, and we will see each type in the following sections.

..................Content has been hidden....................

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