Didomi · API Governance Rules

Didomi API Rules

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

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

Rule Categories

didomi

Rules

warn
didomi-info-title-prefix
API titles SHOULD start with "Didomi" to make the provider explicit.
$.info.title
error
didomi-info-description-required
API descriptions MUST be present.
$.info
error
didomi-servers-https
Server URLs MUST use HTTPS — Didomi redirects HTTP with a 301.
$.servers[*].url
warn
didomi-server-v1-prefix
Server URLs SHOULD include the /v1 versioned base path.
$.servers[*].url
warn
didomi-paths-kebab-case
Path segments SHOULD be kebab-case (consents/events, widgets/notices, sso-connections).
$.paths[*]~
error
didomi-operation-summary
Every operation MUST have a summary.
$.paths[*][*]
error
didomi-operation-tags
Every operation MUST be tagged with at least one of the Didomi resource group tags (consents/*, widgets/*, metadata/*, taxonomies, domains, secrets, keys, etc.).
$.paths[*][*]
warn
didomi-bearer-security
The API uses bearer JWT authentication — operations SHOULD declare bearer security except for /sessions endpoints that exchange API key + secret.
$.paths[?(@property != '/sessions' && @property != '/sessions/{id}')][*]
warn
didomi-error-responses
Operations SHOULD document 401 (missing/expired token), 429 (rate limit exceeded), and a default 4xx envelope.
$.paths[*][*].responses
info
didomi-pagination-shape
List operations SHOULD support cursor / offset pagination via standard query parameters.
$.paths[*].get.parameters

Spectral Ruleset

Raw ↑
extends:
- spectral:oas
documentationUrl: https://developers.didomi.io/api-and-platform/introduction
rules:
  didomi-info-title-prefix:
    description: API titles SHOULD start with "Didomi" to make the provider explicit.
    given: $.info.title
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^Didomi"
  didomi-info-description-required:
    description: API descriptions MUST be present.
    given: $.info
    severity: error
    then:
      field: description
      function: truthy
  didomi-servers-https:
    description: Server URLs MUST use HTTPS — Didomi redirects HTTP with a 301.
    given: $.servers[*].url
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "^https://"
  didomi-server-v1-prefix:
    description: Server URLs SHOULD include the /v1 versioned base path.
    given: $.servers[*].url
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "/v1$"
  didomi-paths-kebab-case:
    description: Path segments SHOULD be kebab-case (consents/events, widgets/notices, sso-connections).
    given: $.paths[*]~
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^/[A-Za-z0-9/_{}\\-]+$"
  didomi-operation-summary:
    description: Every operation MUST have a summary.
    given: $.paths[*][*]
    severity: error
    then:
      field: summary
      function: truthy
  didomi-operation-tags:
    description: Every operation MUST be tagged with at least one of the Didomi resource group tags (consents/*, widgets/*, metadata/*, taxonomies, domains, secrets, keys, etc.).
    given: $.paths[*][*]
    severity: error
    then:
      field: tags
      function: truthy
  didomi-bearer-security:
    description: The API uses bearer JWT authentication — operations SHOULD declare bearer security except for /sessions endpoints that exchange API key + secret.
    given: $.paths[?(@property != '/sessions' && @property != '/sessions/{id}')][*]
    severity: warn
    then:
      field: security
      function: truthy
  didomi-error-responses:
    description: Operations SHOULD document 401 (missing/expired token), 429 (rate limit exceeded), and a default 4xx envelope.
    given: $.paths[*][*].responses
    severity: warn
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          anyOf:
          - required: ["401"]
          - required: ["default"]
  didomi-pagination-shape:
    description: List operations SHOULD support cursor / offset pagination via standard query parameters.
    given: $.paths[*].get.parameters
    severity: info
    then:
      function: schema
      functionOptions:
        schema:
          type: array

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/didomi-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.