Demandbase · API Governance Rules

Demandbase API Rules

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

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

Rule Categories

demandbase

Rules

warn
demandbase-info-contact
API info should include Demandbase support contact.
$.info
warn
demandbase-base-url
Servers should reference api.demandbase.com.
$.servers[*].url
error
demandbase-apikey-auth
API should declare apiKey authentication.
$.components.securitySchemes
warn
demandbase-operation-tags
Operations should be tagged Accounts, Enrichment, Firmographics, etc.
$.paths[*][*]
warn
demandbase-accounts-resource
API should expose /accounts as a primary resource.
$.paths

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  demandbase-info-contact:
    description: API info should include Demandbase support contact.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy
  demandbase-base-url:
    description: Servers should reference api.demandbase.com.
    given: $.servers[*].url
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "demandbase\\.com"
  demandbase-apikey-auth:
    description: API should declare apiKey authentication.
    given: $.components.securitySchemes
    severity: error
    then:
      field: apiKeyAuth
      function: truthy
  demandbase-operation-tags:
    description: Operations should be tagged Accounts, Enrichment, Firmographics, etc.
    given: $.paths[*][*]
    severity: warn
    then:
      field: tags
      function: truthy
  demandbase-accounts-resource:
    description: API should expose /accounts as a primary resource.
    given: $.paths
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "/accounts"