Skip to content

[RFD] API Versioning #78

@jsollom-hpe

Description

@jsollom-hpe

API Versioning

What needs to change:

In the past, APIs have been versioned as a whole where the version encompasses all of the endpoints. This leads to a monolithic view of the API preventing it from being more composable. Changes in one resource require bumping the global API version. There is potential for more frequent version churn. We should move away from versioning the entire API.

What do you propose?

Versioning will be done on a resource basis. Each resource-collection will be versioned as opposed to the entire API being versioned. This composability allows changes to individual resources without affecting the remainder of the API.

The version will precede the resource-collection. The URI syntax is as follows:

/api-group/version/resource-collection/

Examples:
GET /storage/v1/storage-systems

GET /storage/v2/storage-systems

The Google AIP-185 API Versioning puts the major version number in the URI. The use of the term "major version number" is taken from semantic versioning at semver.org. However, unlike in traditional semantic versioning, Google APIs must not expose minor or patch version numbers. For example, Google APIs use v1, not v1.0, v1.1, or v1.4.2. From a user's perspective, major versions are updated in place, and users receive new functionality without migration. For this reason, this RFD suggests only using the major version number in the URL.

When incrementing the version on a resource-collection, the sunset HTTP header field could be used to indicate when a resource-collection is being deprecated.
See this standard for IETF RFC 8594 The Sunset HTTP Header Field.

What alternatives exist?

The version could be specified in the request HEADER.
Example: GET /users with header Accept: application/vnd.myapi.v2+json

Pros:
• Clean URLs.
• Can support multiple representations or minor variations.
• Encouraged in REST-style APIs.

Cons:
• Harder for humans to discover.
• Not cache-friendly.
• Poor support in some tools or proxies.

Reference: IETF RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content, specifically the Accept header

This Github API Versions document describes an alternate method for supplying the version in the header.

Related RFDs

Metadata

Metadata

Assignees

No one assigned

    Labels

    rfdRequest for Discussionsummit-2025Roadmap items we want to review at the 2025 OpenCHAMI Developer Summit

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions