Linting Rules - OpenAPI V3 - Version Semantic

Number of APIs: 1

An API governance linting rule to enforce that semantic versioning has been applied to an OpenAPI, making sure that all teams are using the same versioning patterns, and all APIs are being versioned.

{
  "openapi-v3-version-semantic": {
    "description": "Ensuring that semantic versioning is being used.",
    "message": "You need to provide a semantic version.",
    "severity": "error",
    "recommended": true,
    "given": "$.info.version",
    "then": {
      "function": "pattern",
      "functionOptions": {
        "match": "^[0-9]+.[0-9]+.[0-9]+(-[a-z0-9+.-]+)?"
      }
    }
  }
}

This request can be run as part of this collection or dragged and dropped to another collection of governance requests organized by folder, demonstrating how API governance linting works, but also providing a rule that can be used as part of your wider API governance strategy.

  1. OpenAPI V3 - Version Semantic POST {{baseUrl}}/linter?rulesUrl=https://rules.linting.org/rules/openapi-v3-version-semantic/