dbt · API Governance Rules

dbt API Rules

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

5 Rules error 1 warn 4
View Rules File View on GitHub

Rule Categories

dbt

Rules

warn
dbt-info-contact
API info should include a dbt Labs contact.
$.info
warn
dbt-cloud-base-url
Servers should reference cloud.getdbt.com.
$.servers[*].url
error
dbt-bearer-auth
API should declare a bearer token security scheme.
$.components.securitySchemes
warn
dbt-account-scoped-paths
Resource paths should be scoped under /accounts/{accountId}.
$.paths
warn
dbt-operation-tags
Operations should be tagged Accounts, Projects, Jobs, Runs, or Environments.
$.paths[*][*]

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  dbt-info-contact:
    description: API info should include a dbt Labs contact.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy
  dbt-cloud-base-url:
    description: Servers should reference cloud.getdbt.com.
    given: $.servers[*].url
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "cloud\\.getdbt\\.com"
  dbt-bearer-auth:
    description: API should declare a bearer token security scheme.
    given: $.components.securitySchemes
    severity: error
    then:
      field: bearerAuth
      function: truthy
  dbt-account-scoped-paths:
    description: Resource paths should be scoped under /accounts/{accountId}.
    given: $.paths
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "/accounts/"
  dbt-operation-tags:
    description: Operations should be tagged Accounts, Projects, Jobs, Runs, or Environments.
    given: $.paths[*][*]
    severity: warn
    then:
      field: tags
      function: truthy