Cycloid · API Governance Rules

Cycloid API Rules

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

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

Rule Categories

cycloid

Rules

warn
cycloid-info-contact
Cycloid API spec must declare a contact.
$.info
error
cycloid-server-https
Cycloid server URLs must use HTTPS.
$.servers[*].url
error
cycloid-base-url
Cycloid base URL must be http-api.cycloid.io.
$.servers[*].url
warn
cycloid-tags-required
Every operation must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
error
cycloid-operation-id-required
Every operation must declare an operationId.
$.paths[*][get,post,put,patch,delete]
warn
cycloid-organization-scoped
Resource paths must be scoped under /organizations/{organization_canonical}.
$.paths

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  cycloid-info-contact:
    description: Cycloid API spec must declare a contact.
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  cycloid-server-https:
    description: Cycloid server URLs must use HTTPS.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: '^https://'
  cycloid-base-url:
    description: Cycloid base URL must be http-api.cycloid.io.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: '^https://http-api\.cycloid\.io'
  cycloid-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
  cycloid-operation-id-required:
    description: Every operation must declare an operationId.
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  cycloid-organization-scoped:
    description: Resource paths must be scoped under /organizations/{organization_canonical}.
    severity: warn
    given: $.paths
    then:
      function: pattern
      functionOptions:
        match: 'organizations/\{organization_canonical\}'