The term API version refers to what is written in the version field of an API OAS definition file.

The reference documentation is in the Commonalities repository in GitHub here: API design guidelines (in section 5).


API versioning is done using SemVer 2.0.0: vx.y.z with x, y and z being numbers indicating MAJOR, MINOR and PATCH versions.

In addition to the target public API versions x.y.z, internally to the CAMARA project during the API release process version extensions are used for pre-releases (described in the section below):0.10.0

  • alpha API versions

  • release-candidate API versions

Finally,

  • work-in-progress (wip) is used as the API version before the first pre-release and between 2 pre-releases

  • IMPORTANT: CAMARA public APIs with x=0 (v0.x.y) MUST use both the MAJOR and the MINOR version number separated by a dot (".") in the API version in the OAS servers/url field: v0.y, e.g. e.g. {apiRoot}/qod/v0.10

The following types of API versions are used throughout an API's release process:

The use of the different API versions throughout the API release process is illustrated in the following figure.

The next sections provide the definition of terms used and the description of the different API version types when moving through the release process.

Definitions

API version

The API version is defined in the "version" field of the OAS definition file of an API. Its content must follow Semantic Versioning 2.0.0 | Semantic Versioning (semver.org).

An API version has the format:  x.y.z  where x, y and z are numbers corresponding to MAJOR, MINOR and PATCH versions.

The following bullets are extracted of the semver 2.0 specification (and links to the corresponding spec item):

Note: in CAMARA v1.0.0 is considered the first stable public API, while API versions v0.y.z can be public, but are considered unstable (initial).

Precedence example:  0.10.0 < 1.0.0 < 2.0.0 < 2.1.0 < 2.1.1 < 3.0.0.

API version extensions

During API development and release preparation, API version extensions are used to identify intermediate versions of an API.  

The API version extension is added to the "version" field of the OAS definition of an API, as well as to the URL (see below table). Its content must follow the here described syntax and semantics.

The following extensions may be used in the API version:

Extensions are post-fixed to the API version numbers and separated from it by a hyphen "-". m and n are numbers starting at 1.

All extensions must have a number (so just -alpha or -rc is not allowed) and should be minimally -alpha.1 or -rc.1.

The very first version of an API for which a release can be created is 0.1.0-alpha.1.

API version in URL

The OAS API definition file contains the URL definition for the API endpoint which includes the version of the API with the following format:

servers:

    url: {apiRoot}/qod/v2

API name

The API name is the segment in the url field in the OAS definition file before the segment holding the API version.

Example: for the above url: {apiRoot}/qod/v2, the API name is qod.

API version types

The following tables provides the characteristics of the different API version types that an API will go through during its release process.

API version typePurpose & characteristics

work-in-progress (wip)

The purpose of a work-in-progress API version is to indicate that the API is unstable due to one or more PRs being committed, possibly resulting in temporary inconsistencies.

  • A work in progress (wip) API version has the following information in the API OAS definition file: 
    • Info object - version: wip (instead of x.y.z) 
    • Servers object - url: vwip (instead of vx)
  • A wip API version may exist in 2 cases
    • during the first introduction of a new API upto the creation of the first alpha API version
    • during the time that one or more Pull Requests (PRs) are committed after a given release of an API.
  • Between different PR commits, the API version remains "wip".
  • After or with the last PR commit, the API version and URL version are set to the next API version.
  • The maintainers of the API decide on the release (or not) of the resulting next API version, implying that its corresponding release assets will be created.

alpha (alpha)

The purpose of an alpha API version is to support rapid development of an API and the creation of test implementations for feedback purposes.

  • An alpha API version (x.y.z alpha.m) is an intermediate API version with changes with respect to a previous API version.

release-candidate (rc)

The purpose of a release-candidate API version is to allow for (only) bug fixing encountered during further API implementation testing. 

  • A release-candidate API version (x.y.z-rc.n) is a pre-release of an API version which is stabilized and intended to become the next public API version.
  • It shall be used to create API implementations and test the API and to create required release assets.

public

The purpose of a public API version is that it can be used by organizations outside CAMARA in application development and commercial contexts.

  • A public API version (x.y.z) can be more or less mature:
    • A public API version with x=0 is referred as an initial API version.
    • A public API version with x>0 is referred to as a stable API version.

initial

Initial public API versions only exist for new APIs.

  • They are API versions with x = 0 (0.y.z without version extension).
  • IMPORTANT: for an initial public API version (with x=0), the API version in the URL MUST also include the y (MINOR) version number v0.y (with the dot). This is to simplify the testing of different initial public API versions.

    For initial public API versions:  

    • An update due to a breaking change in a public API version 0.y.z results in a next public API version: 0.y+1.0. Example: 0.9.0 → 0.10.0

    • An update due to a non-breaking change results in an API version change from 0.y.z to API version 0.y.z+1. Example: 0.9.0 → 0.9.1

stable

Stable public API versions are public API versions with x > 0 (x.y.z without version extension).

Stable public API versions are the ones recommended for use in commercial applications. The user can expect that subsequent API versions will be backward-compatible with the one they are using, unless explicitly announced otherwise.

Creation of a public API version

To create a public version of an API the following steps need to be taken:

All alpha and release-candidate API versions are INTERNAL to the CAMARA project and meant to be used only for the API development and release management process. Usage for other purpose is at the user's own risk.

The below table gives an overview of the API versioning through the release process. The column headers mean the following:

The following table gives the values of the API version (Info object) and the API version in the URL (servers object) used during the release process of an API version.

API version types in the release processAPI version
(OAS Info object)
initial (x=0) API version in URL (OAS Servers object)
stable (x>=1) API version in URL (OAS Servers object)API version can be released
work-in-progresswipvwipvwipNo
alphax.y.z-alpha.mv0.yalphamvxalphamYes (internal pre-release)
release-candidate x.y.z-rc.nv0.yrcnvxrcnYes (internal pre-release)

public

x.y.z

v0.y

vx

Yes (release)

Precedence examples for API versions throughout the release process:

Update of a public API version

Updates to a public API version can concern MAJOR, MINOR or PATCH changes to the API definition.

It is recommended to have maximally 2 consecutive public API versions available at any given point in time.

Breaking and non-breaking changes

Semantic versioning on breaking changes:

What is a breaking change?

What is a non-breaking change?

How to avoid breaking changes (API provider) ?

How to avoid breaking changes (API consumer) ?

Make the information available:

Bearing in mind that APIs are continually evolving and certain operations will no longer be supported, the following considerations must be taken into account: