Decentro · API Governance Rules

Decentro API Rules

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

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

Rule Categories

decentro

Rules

warn
decentro-info-contact
API info should declare a Decentro contact.
$.info
warn
decentro-base-url
Servers should reference decentro.tech.
$.servers[*].url
error
decentro-api-key-security
API should declare client_secret API key authentication.
$.components.securitySchemes
warn
decentro-v2-paths
API resources should be versioned under /v2.
$.paths
warn
decentro-operation-tags
Operations should be tagged Collections, Payouts, Mandates, or Settlements.
$.paths[*][*]

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  decentro-info-contact:
    description: API info should declare a Decentro contact.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy
  decentro-base-url:
    description: Servers should reference decentro.tech.
    given: $.servers[*].url
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "decentro\\.tech"
  decentro-api-key-security:
    description: API should declare client_secret API key authentication.
    given: $.components.securitySchemes
    severity: error
    then:
      field: apiKey
      function: truthy
  decentro-v2-paths:
    description: API resources should be versioned under /v2.
    given: $.paths
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "/v2/"
  decentro-operation-tags:
    description: Operations should be tagged Collections, Payouts, Mandates, or Settlements.
    given: $.paths[*][*]
    severity: warn
    then:
      field: tags
      function: truthy