Cisco Hardware · API Governance Rules

Cisco Hardware API Rules

Spectral linting rules defining API design standards and conventions for Cisco Hardware.

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

Rule Categories

cisco

Rules

warn
cisco-hardware-info-contact
API info object MUST contain a contact for Cisco Hardware APIs.
$.info
error
cisco-hardware-https-only
All Cisco Hardware API servers MUST use HTTPS.
$.servers[*].url
warn
cisco-hardware-tag-required
Operations MUST be tagged for hardware domain grouping.
$.paths[*][get,post,put,delete,patch].tags
error
cisco-hardware-operation-id
Operations MUST have an operationId.
$.paths[*][get,post,put,delete,patch]
warn
cisco-hardware-summary-required
Operations MUST have a summary.
$.paths[*][get,post,put,delete,patch]
error
cisco-hardware-security-required
API MUST define security schemes for token, basic-auth, or signature auth.
$.components.securitySchemes

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
  - spectral:asyncapi
rules:
  cisco-hardware-info-contact:
    description: API info object MUST contain a contact for Cisco Hardware APIs.
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  cisco-hardware-https-only:
    description: All Cisco Hardware API servers MUST use HTTPS.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: '^https://'
  cisco-hardware-tag-required:
    description: Operations MUST be tagged for hardware domain grouping.
    severity: warn
    given: $.paths[*][get,post,put,delete,patch].tags
    then:
      function: truthy
  cisco-hardware-operation-id:
    description: Operations MUST have an operationId.
    severity: error
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: operationId
      function: truthy
  cisco-hardware-summary-required:
    description: Operations MUST have a summary.
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: summary
      function: truthy
  cisco-hardware-security-required:
    description: API MUST define security schemes for token, basic-auth, or signature auth.
    severity: error
    given: $.components.securitySchemes
    then:
      function: truthy