OpenAPI
Notation follows the APIs index.
APIs MUST be documented in OpenAPI format.
- APIs
MUSTprovide a description written with the API consumer as the audience in mind, free of implementation details. - APIs
SHOULDprovide realistic example JSON for both the request and response. - APIs
SHOULDdocument which attributes are filterable and which are sortable. - Fields that must always be present
MUSTbe marked asrequired. - Fields whose value may be null
MUSTbe marked asnullable. - Fields whose value is set by the server
MUSTbe marked asreadOnly. The one exception isversion, whichMUST NOTbe markedreadOnlybecause callers send it back on update, as optimistic concurrency explains. - If a single-resource request includes a read-only field, the API
MUSTignore it. A bulk update that names a read-only field is instead rejected with422.
Operation identifiers
Every operation MUST carry an explicit, stable
operationId. "v1" APIs SHOULD NOT
include the version number but "v2" APIs MUST in order to generate stable clients, as in
getGroup and getGroupV2. These IDs are necessary for stable, generated clients:
- Without the version,
/api/v1/groups/{id}and/api/v2/groups/{id}collide into one method name. - Without an explicit identifier, generators invent one from the route which can be brittle.