CockroachDB · API Governance Rules

CockroachDB API Rules

Spectral linting rules defining API design standards and conventions for CockroachDB.

10 Rules error 3 warn 4 info 3
View Rules File View on GitHub

Rule Categories

cockroachdb

Rules

error
cockroachdb-info-contact
API contact information must be present.
$.info
warn
cockroachdb-terms-of-service
termsOfService must reference cockroachlabs.com.
$.info.termsOfService
warn
cockroachdb-server-https
Public server URLs must use HTTPS (cluster API loopback exempt).
$.servers[?(@.url && @.url.indexOf('localhost') === -1)].url
info
cockroachdb-cloud-base-host
Cloud API server URL must point to cockroachlabs.cloud.
$.servers[?(@.url && @.url.indexOf('cockroachlabs.cloud') > -1)].url
error
cockroachdb-bearer-security
Cloud API operations must define a bearer-token security scheme.
$.components.securitySchemes[*]
error
cockroachdb-operation-id
Every operation must declare a unique operationId.
$.paths[*][get,post,put,patch,delete]
warn
cockroachdb-operation-tags
Operations must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
cockroachdb-error-responses
Mutating operations should declare 4xx/5xx error responses.
$.paths[*][post,put,patch,delete].responses
info
cockroachdb-uuid-cluster-id
Path parameters named cluster_id should be UUIDs.
$.paths[*].*.parameters[?(@.in == 'path' && @.name == 'cluster_id')].schema
info
cockroachdb-headers-allowlist
Use canonical CockroachDB request headers (Cc-Version, X-Cockroach-API-Session, Authorization).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in == 'header')]