SSH · API Governance Rules

SSH API Rules

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

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

Rule Categories

ssh

Rules

warn
ssh-operation-summary-title-case
All operation summaries must use Title Case
$.paths[*][*].summary
warn
ssh-operationid-camel-case
operationId must use camelCase
$.paths[*][*].operationId
error
ssh-tags-required
Every operation must have at least one tag
$.paths[*][*]
warn
ssh-description-required
All operations must have a description
$.paths[*][*].description
error
ssh-key-operations-security
All key management operations must require authentication
$.paths[*/keys*][*]
error
ssh-response-success-required
All operations must define a success response
$.paths[*][get,post,put,delete]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  ssh-operation-summary-title-case:
    description: All operation summaries must use Title Case
    severity: warn
    given: "$.paths[*][*].summary"
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-z0-9]*\\s?)+$"

  ssh-operationid-camel-case:
    description: operationId must use camelCase
    severity: warn
    given: "$.paths[*][*].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  ssh-tags-required:
    description: Every operation must have at least one tag
    severity: error
    given: "$.paths[*][*]"
    then:
      field: tags
      function: truthy

  ssh-description-required:
    description: All operations must have a description
    severity: warn
    given: "$.paths[*][*].description"
    then:
      function: truthy

  ssh-key-operations-security:
    description: All key management operations must require authentication
    severity: error
    given: "$.paths[*/keys*][*]"
    then:
      field: security
      function: truthy

  ssh-response-success-required:
    description: All operations must define a success response
    severity: error
    given: "$.paths[*][get,post,put,delete]"
    then:
      field: responses
      function: truthy