Skip to content

Commit 8f1ffc6

Browse files
authored
Update API-design-guidelines.md
included updates on removing"-" in release names some more tweeks
1 parent 85ceb7a commit 8f1ffc6

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

documentation/API-design-guidelines.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ This document captures guidelines for the API design in CAMARA project. These gu
2727
- [4.1 URL Definition](#41-url-definition)
2828
- [4.2 Input/Output Resource Definition](#42-inputoutput-resource-definition)
2929
- [5. Versioning](#5-versioning)
30-
- [5.1 API version (OAS Info object)](#51-api-version-oas-info-object)
30+
- [5.1 API version (OAS info object)](#51-api-version-oas-info-object)
3131
- [5.2 API version in URL (OAS servers object)](#52-api-version-in-url-oas-servers-object)
3232
- [5.3 API versions throughout the release process](#53-api-versions-throughout-the-release-process)
33-
- [5.4 Backwards and Forward Compatibility](#54-backwards-and-forward-compatibility)
33+
- [5.4 Backward and forward compatibility](#54-backward-and-forward-compatibility)
3434
- [6. Error Responses](#6-error-responses)
3535
- [7. Common Data Types](#7-common-data-types)
3636
- [8. Pagination, Sorting and Filtering](#8-pagination-sorting-and-filtering)
@@ -541,16 +541,16 @@ These considerations are below:
541541

542542
Versioning is a practice by which, when a change occurs in the API, a new version of that API is created.
543543

544-
API versions use a numbering scheme in the format: x.y.z
544+
API versions use a numbering scheme in the format: `x.y.z`
545545

546546
* x, y and z are numbers corresponding to MAJOR, MINOR and PATCH versions.
547547
* MAJOR, MINOR and PATCH refer to the types of changes made to an API through its evolution.
548548
* Depending on the change type, the corresponding number is incremented.
549549
* This is defined in the [Semantic Versioning 2.0.0 (semver.org)](https://semver.org/) standard.
550550

551-
### 5.1 API version (OAS Info object)
551+
### 5.1 API version (OAS info object)
552552

553-
The API version is defined in the "version" field (in the Info object) of the OAS definition file of an API. 
553+
The API version is defined in the `version` field (in the `info` object) of the OAS definition file of an API. 
554554

555555
```yaml
556556
info:
@@ -568,13 +568,13 @@ In line with Semantic Versioning 2.0.0, the API with MAJOR.MINOR.PATCH versio
568568

569569
For more details on MAJOR, MINOR and PATCH versions, and how to evolve API versions, please see [API versioning](https://wiki.camaraproject.org/x/a4BaAQ) in the CAMARA wiki. 
570570

571-
It is recommended to avoid breaking backwards compatibility unless strictly necessary: new versions should be backwards compatible with previous versions. More information on how to avoid breaking changes can be found below.
571+
It is recommended to avoid breaking backward compatibility unless strictly necessary: new versions should be backwards compatible with previous versions. More information on how to avoid breaking changes can be found below.
572572

573573
### 5.2 API version in URL (OAS servers object)
574574

575-
The OAS file also defines the API version used in the URL of the API endpoint (in the servers object).
575+
The OAS file also defines the API version used in the URL of the API (in the `servers` object).
576576

577-
The API version in the URL only includes the "x" (MAJOR version) number of the API version as follows:
577+
The API version in the `url` field only includes the "x" (MAJOR version) number of the API version as follows:
578578

579579
```yaml
580580
servers:
@@ -583,7 +583,7 @@ servers:
583583
584584
---
585585
586-
IMPORTANT: CAMARA initial public APIs (see explanation below) shall use both the MAJOR and the MINOR version number (v0.y) separated by a dot (".") in the API version in the URL.
586+
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 `url` field: `v0.y`.
587587

588588
---
589589

@@ -592,18 +592,18 @@ servers:
592592
    url: {apiRoot}/number-verification/v0.3
593593
```
594594

595-
This allows for test and usage of initial API versions as they are evolving rapidly, e.g. /qod/v0.10, or /qod/v0.11alpha1. However, it should be acknowledged that any initial API version may change.
595+
This allows for both test and commercial usage of initial API versions as they are evolving rapidly, e.g. `/qod/v0.10alpha1`, `/qod/v0.10rc1`, or `/qod/v0.10`. However, it should be acknowledged that any initial API version may change.
596596

597597
### 5.3 API versions throughout the release process
598598

599599
In preparation for its public release, an API will go through various intermediate versions indicated by version extensions: alpha and release-candidate.
600600

601601
Overall, an API can have any of the following versions:
602602

603-
* work-in-progress (wip) API versions used during the development of an API before the first pre-release or in between pre-releases. Such API versions cannot be released and are not usable by API consumers.
604-
* alpha (x.y.z-alpha.m) API versions (with extensions) for CAMARA internal API rapid development purposes
605-
* release-candidate (x.y.z-rc.n) API versions (with extensions) for CAMARA internal API release bug fixing purposes
606-
* public (x.y.z) API versions for usage in commercial contexts. These API versions only have API version number x.y.z (semver 2.0), no extension. Public APIs can have one of two maturity states: 
603+
* work-in-progress (`wip`) API versions used during the development of an API before the first pre-release or in between pre-releases. Such API versions cannot be released and are not usable by API consumers.
604+
* alpha (`x.y.z-alpha.m`) API versions (with extensions) for CAMARA internal API rapid development purposes
605+
* release-candidate (`x.y.z-rc.n`) API versions (with extensions) for CAMARA internal API release bug fixing purposes
606+
* public (`x.y.z`) API versions for usage in commercial contexts. These API versions only have API version number x.y.z (semver 2.0), no extension. Public APIs can have one of two maturity states (used in release management)
607607
* initial - indicating that the API is still not fully stable (x=0)
608608
* stable - indicate that the API has reached a certain level of maturity (x>0)
609609

@@ -624,9 +624,9 @@ Precedence examples:
624624

625625
For more information, please see [API versioning](https://wiki.camaraproject.org/x/a4BaAQ) in the Release Management project Wiki.
626626

627-
### 5.4 Backwards and Forward Compatibility
627+
### 5.4 Backward and forward compatibility
628628

629-
Avoid breaking backwards compatibility, unless strictly necessary, means that new versions should be compatible with previous versions.
629+
Avoid breaking backward compatibility, unless strictly necessary, means that new versions should be compatible with previous versions.
630630

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

@@ -636,7 +636,7 @@ Bearing in mind that APIs are continually evolving and certain operations will n
636636
- Remove deprecated APIs documentation.
637637
- Never start using already deprecated APIs.
638638

639-
<font size="3"><span style="color: blue"> Types of modification: </span></font>
639+
Types of modification:
640640

641641
- Not all API changes have an impact on API consumers. These are referred to as backward compatible changes.
642642
- In case of such changes, the update produces a new API version that increases the MINOR or PATCH version number.
@@ -660,9 +660,9 @@ Breaking changes to an API that **DO** affect consumers:
660660
- Modifying or removing a mandatory parameter in existing operations (resource verbs). For example, when consulting a resource, a certain field is no longer returned. Another example: a field that was previously a string is now numeric.
661661
- Modifying or adding new responses to existing operations. For example: creating a resource can return a 412 response code.
662662

663-
<font size="3"><span style="color: blue"> Compatibility management </span></font>
663+
Compatibility management:
664664

665-
Tho ensure this compatibility, the following must be followed.
665+
To ensure this compatibility, the following guidelines must be applied.
666666

667667
**As API provider**:
668668
- Never change an endpoint name; instead, add a new one and mark the original one for deprecation in a MINOR change and remove it in a later MAJOR change (see semver FAQ entry: https://semver.org/#how-should-i-handle-deprecating-functionality)

0 commit comments

Comments
 (0)