Dolby.io · API Governance Rules

Dolby.io API Rules

Spectral linting rules defining API design standards and conventions for Dolby.io.

8 Rules error 3 warn 5
View Rules File View on GitHub

Rule Categories

dolby

Rules

warn
dolby-info-contact
Every Dolby.io API must declare contact information pointing at Dolby support.
$.info
error
dolby-info-description
Every Dolby.io API must include an info.description.
$.info
error
dolby-server-https
Dolby.io REST servers must use HTTPS.
$.servers[*].url
warn
dolby-bearer-auth
Dolby OptiView Real-time Streaming endpoints must declare Bearer authentication.
$.components.securitySchemes
warn
dolby-operation-summary-title-case
Operation summaries must use Title Case.
$.paths[*][get,post,put,patch,delete].summary
warn
dolby-operation-id-camel-case
operationId must be camelCase.
$.paths[*][get,post,put,patch,delete].operationId
warn
dolby-tag-required
Every operation must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
error
dolby-2xx-response
Every operation must define at least one 2xx response.
$.paths[*][get,post,put,patch,delete].responses

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
documentationUrl: https://github.com/api-evangelist/dolby-io
formats:
  - oas3
functions: []
rules:
  dolby-info-contact:
    description: Every Dolby.io API must declare contact information pointing at Dolby support.
    given: '$.info'
    severity: warn
    then:
      field: contact
      function: truthy
  dolby-info-description:
    description: Every Dolby.io API must include an info.description.
    given: '$.info'
    severity: error
    then:
      field: description
      function: truthy
  dolby-server-https:
    description: Dolby.io REST servers must use HTTPS.
    given: '$.servers[*].url'
    severity: error
    then:
      function: pattern
      functionOptions:
        match: '^https://'
  dolby-bearer-auth:
    description: Dolby OptiView Real-time Streaming endpoints must declare Bearer authentication.
    given: '$.components.securitySchemes'
    severity: warn
    then:
      function: truthy
  dolby-operation-summary-title-case:
    description: Operation summaries must use Title Case.
    given: '$.paths[*][get,post,put,patch,delete].summary'
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z][A-Za-z0-9 ]+$'
  dolby-operation-id-camel-case:
    description: operationId must be camelCase.
    given: '$.paths[*][get,post,put,patch,delete].operationId'
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]+$'
  dolby-tag-required:
    description: Every operation must declare at least one tag.
    given: '$.paths[*][get,post,put,patch,delete]'
    severity: warn
    then:
      field: tags
      function: truthy
  dolby-2xx-response:
    description: Every operation must define at least one 2xx response.
    given: '$.paths[*][get,post,put,patch,delete].responses'
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          patternProperties:
            '^2[0-9]{2}$':
              type: object
          additionalProperties: true