Cockroach Labs · API Governance Rules
Cockroach Labs API Rules
Spectral linting rules defining API design standards and conventions for Cockroach Labs.
10 Rules
error 3
warn 4
info 3
Rule Categories
cockroach
Rules
error
cockroach-labs-info-contact
API contact information must be present.
$.info
warn
cockroach-labs-terms-of-service
termsOfService must reference cockroachlabs.com.
$.info.termsOfService
warn
cockroach-labs-server-https
Public server URLs must use HTTPS (cluster API loopback exempt).
$.servers[?(@.url && @.url.indexOf('localhost') === -1)].url
info
cockroach-labs-cloud-base-host
Cloud API server URL must point to cockroachlabs.cloud.
$.servers[?(@.url && @.url.indexOf('cockroachlabs.cloud') > -1)].url
error
cockroach-labs-bearer-security
Cloud API operations must define a bearer-token security scheme.
$.components.securitySchemes[*]
error
cockroach-labs-operation-id
Every operation must declare a unique operationId.
$.paths[*][get,post,put,patch,delete]
warn
cockroach-labs-operation-tags
Operations must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
cockroach-labs-error-responses
Mutating operations should declare 4xx/5xx error responses.
$.paths[*][post,put,patch,delete].responses
info
cockroach-labs-uuid-cluster-id
Path parameters named cluster_id should be UUIDs.
$.paths[*].*.parameters[?(@.in == 'path' && @.name == 'cluster_id')].schema
info
cockroach-labs-cc-version-header
Cloud API requests should support the Cc-Version versioning header.
$.paths[*][get,post,put,patch,delete].parameters[?(@.in == 'header')]