Couchbase · API Governance Rules

Couchbase API Rules

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

5 Rules error 3 warn 2
View Rules File View on GitHub

Rule Categories

couchbase

Rules

error
couchbase-capella-info-title
API title must mention Capella.
$.info.title
warn
couchbase-capella-server-url
Servers must reference cloudapi.cloud.couchbase.com.
$.servers[*].url
error
couchbase-capella-operation-id
Every operation must define an operationId.
$.paths.*.*
error
couchbase-capella-operation-tags
Every operation must define at least one tag.
$.paths.*.*
warn
couchbase-capella-security
Capella API operations must declare security requirements.
$

Spectral Ruleset

Raw ↑
extends: ["spectral:oas"]
documentationUrl: https://docs.couchbase.com/cloud/management-api-reference/index.html
rules:
  couchbase-capella-info-title:
    description: API title must mention Capella.
    given: "$.info.title"
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "Capella"
  couchbase-capella-server-url:
    description: Servers must reference cloudapi.cloud.couchbase.com.
    given: "$.servers[*].url"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "cloudapi.cloud.couchbase.com"
  couchbase-capella-operation-id:
    description: Every operation must define an operationId.
    given: "$.paths.*.*"
    severity: error
    then:
      field: operationId
      function: truthy
  couchbase-capella-operation-tags:
    description: Every operation must define at least one tag.
    given: "$.paths.*.*"
    severity: error
    then:
      field: tags
      function: truthy
  couchbase-capella-security:
    description: Capella API operations must declare security requirements.
    given: "$"
    severity: warn
    then:
      field: security
      function: truthy