Dun & Bradstreet · API Governance Rules

Dun & Bradstreet API Rules

Spectral linting rules defining API design standards and conventions for Dun & Bradstreet.

8 Rules error 3 warn 4 info 1
View Rules File View on GitHub

Rule Categories

dnb

Rules

warn
dnb-duns-field-name
Identifier for a business should use the field name `duns`.
$.components.schemas..properties
error
dnb-operation-id-camel-case
Direct+ operationIds are lowerCamelCase verbs.
$.paths.*[get,post,put,delete,patch]
warn
dnb-tags-title-case
Tags use Title Case.
$.tags[*].name
warn
dnb-summary-title-case
Operation summaries use Title Case.
$.paths.*[get,post,put,delete,patch].summary
error
dnb-bearer-auth-required
All non-token operations must require bearer auth.
$.paths[?(@property != "/v3/token")].*[get,post,put,delete,patch]
error
dnb-version-in-path
Direct+ paths must be prefixed with /v{n}/.
$.paths
warn
dnb-country-code-iso2
Country codes use ISO 3166-1 alpha-2 (countryISOAlpha2Code).
$..parameters[?(@.name == 'country' || @.name == 'countryCode')]
info
dnb-pagination-page-size
Paginated list endpoints expose pageNumber and pageSize.
$.paths[?(@property =~ /search/)].get.parameters[*].name

Spectral Ruleset

Raw ↑
extends: [[spectral:oas, all]]
documentationUrl: https://directplus.documentation.dnb.com/
rules:
  # D&B Direct+ uses lowerCamelCase for all JSON field names; D-U-N-S Number
  # is the singular identifier that should appear consistently as `duns`.
  dnb-duns-field-name:
    description: Identifier for a business should use the field name `duns`.
    message: 'Use `duns` (not `dunsNumber`, `duns_number`, or `DUNS`) as the identifier field.'
    severity: warn
    given: $.components.schemas..properties
    then:
      field: dunsNumber
      function: falsy
  dnb-operation-id-camel-case:
    description: Direct+ operationIds are lowerCamelCase verbs.
    message: '`operationId` must be lowerCamelCase.'
    severity: error
    given: $.paths.*[get,post,put,delete,patch]
    then:
      field: operationId
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]+$'
  dnb-tags-title-case:
    description: Tags use Title Case.
    message: 'Tag names should use Title Case (e.g. `Identity Resolution`).'
    severity: warn
    given: $.tags[*].name
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z][A-Za-z0-9]*( [A-Z][A-Za-z0-9-+]*)*$'
  dnb-summary-title-case:
    description: Operation summaries use Title Case.
    severity: warn
    given: $.paths.*[get,post,put,delete,patch].summary
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z]'
  dnb-bearer-auth-required:
    description: All non-token operations must require bearer auth.
    severity: error
    given: $.paths[?(@property != "/v3/token")].*[get,post,put,delete,patch]
    then:
      field: security
      function: truthy
  dnb-version-in-path:
    description: Direct+ paths must be prefixed with /v{n}/.
    message: 'Paths must begin with /v1/, /v2/, or /v3/.'
    severity: error
    given: $.paths
    then:
      field: '@key'
      function: pattern
      functionOptions:
        match: '^/v[0-9]+/'
  dnb-country-code-iso2:
    description: Country codes use ISO 3166-1 alpha-2 (countryISOAlpha2Code).
    severity: warn
    given: $..parameters[?(@.name == 'country' || @.name == 'countryCode')]
    then:
      function: falsy
  dnb-pagination-page-size:
    description: Paginated list endpoints expose pageNumber and pageSize.
    severity: info
    given: $.paths[?(@property =~ /search/)].get.parameters[*].name
    then:
      function: enumeration
      functionOptions:
        values: [pageNumber, pageSize, searchTerm, countryISOAlpha2Code]

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/dnb-direct-plus-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.