{"section":"versioning","title":"Versioning Rules","description":"Rules for API versioning and compatibility","totalRules":4,"spectralRules":[{"name":"api-version-defined","severity":"info","message":"API should define a version in info.version","given":"$.info","then":{"field":"version","function":"truthy"}},{"name":"api-version-semver","severity":"info","message":"API version should follow semantic versioning","given":"$.info.version","then":{"function":"pattern","functionOptions":{"match":"^[0-9]+\\.[0-9]+\\.[0-9]+(-[a-zA-Z0-9.]+)?(\\+[a-zA-Z0-9.]+)?$"}}},{"name":"deprecated-has-description","severity":"warn","message":"Deprecated operations should explain deprecation","given":"$.paths[*][*][?(@.deprecated==true)]","then":[{"field":"description","function":"truthy"},{"field":"description","function":"pattern","functionOptions":{"match":"deprecated|sunset|replaced|migration"}}]}],"rules":[{"id":"api-version-required","requirement":"MUST","rule":"API must define a version in info.version","severity":"info","spectralRule":"api-version-defined"},{"id":"semver-format","requirement":"SHOULD","rule":"API version should follow semantic versioning","severity":"info","spectralRule":"api-version-semver","examples":{"notRecommended":["v1","2024-01"],"recommended":["1.0.0","2.1.0-beta"]}},{"id":"deprecation-documentation","requirement":"SHOULD","rule":"Deprecated endpoints should document deprecation","severity":"warn","spectralRule":"deprecated-has-description"},{"id":"no-breaking-changes","requirement":"MUST NOT","rule":"Breaking changes must not be made without version increment","severity":"error","rationale":"Breaking changes without version increment can break existing clients","breakingChanges":["Removing or renaming endpoints","Removing or renaming fields","Changing field types","Making optional fields required","Removing enum values"]}]}