Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .spectral.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,16 +362,6 @@ rules:
# 3.2 Versioning
# -------------------------------------------------------------------------

entur-info-version:
message: "The OpenAPI info.version MUST be a valid semantic version (MAJOR.MINOR.PATCH format, e.g. 1.0.0)."
documentationUrl: "https://github.com/entur/api-guidelines/blob/main/guidelines.md#32-versioning"
severity: error
given: $
then:
field: info.version
function: pattern
functionOptions:
match: "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"

# -------------------------------------------------------------------------
# 3.3 Backward Compatibility - Not directly lintable
Expand Down Expand Up @@ -519,7 +509,7 @@ rules:

entur-language-headers:
message: "Accept-Language and Content-Language should follow IETF BCP 47. And macrolanguages like 'no' should not be used - use 'nb' or 'nn'."
documentationUrl: "https://github.com/entur/api-guidelines/blob/main/guidelines.md#41-language--spelling"
documentationUrl: "https://github.com/entur/api-guidelines/blob/main/guidelines.md#51-language--spelling"
severity: error
given:
- $..parameters[?(@.in=='header' && @.name=='Accept-Language')].example
Expand Down
6 changes: 5 additions & 1 deletion guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ Here, only 1 specification will be shown on the Developer Portal, which is a com
- Example: `https://api.entur.io/sales/v1/orders?distributionChannelId=1`

#### 3.2.2 API Spec Versioning
- :white_check_mark: The info.version field **MUST** be set and follow the semver format (e.g. `1.0.0`). This field can be used to communicate changes in the api, together with a changelog.
API spec versioning is done automatically when [publishing the spec](https://github.com/entur/gha-api/blob/main/README-publish.md).
The version is set based on the [CalVer](https://calver.org/) versioning convention, and uses the format YYYY.MM.MICRO. When the spec is
published, the current year and month is used, and MICRO is set to "00". If a version already exists for the given year and month, "01" is used (and so on).
If the published spec is equal to the current spec, no new version is created. Because versioning is done automatically, the value in `info.version` is ignored,
but must be set in order for linting to pass, therefore a placeholder value like `1.0.0` may be used.
Comment thread
rikard-swahn marked this conversation as resolved.

### 3.3 Backward Compatibility
- :eyes: You **MUST** not remove or modify existing fields or endpoints
Expand Down