Cyclr · API Governance Rules

Cyclr API Rules

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

6 Rules error 3 warn 3
View Rules File View on GitHub

Rule Categories

cyclr

Rules

warn
cyclr-info-contact
Cyclr API spec must declare a contact.
$.info
error
cyclr-server-https
Cyclr server URLs must use HTTPS.
$.servers[*].url
warn
cyclr-tags-required
Every operation must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
error
cyclr-operation-id-required
Every operation must declare an operationId.
$.paths[*][get,post,put,patch,delete]
warn
cyclr-bearer-auth
Cyclr uses bearer-token authentication.
$.components.securitySchemes
error
cyclr-versioned-base-url
Cyclr base URL must include a version segment (/v1.0).
$.servers[*].url

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  cyclr-info-contact:
    description: Cyclr API spec must declare a contact.
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  cyclr-server-https:
    description: Cyclr server URLs must use HTTPS.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: '^https://'
  cyclr-tags-required:
    description: Every operation must declare at least one tag.
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  cyclr-operation-id-required:
    description: Every operation must declare an operationId.
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  cyclr-bearer-auth:
    description: Cyclr uses bearer-token authentication.
    severity: warn
    given: $.components.securitySchemes
    then:
      field: bearerAuth
      function: truthy
  cyclr-versioned-base-url:
    description: Cyclr base URL must include a version segment (/v1.0).
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: '/v[0-9]+(\.[0-9]+)?'