Silverpop · API Governance Rules

Silverpop API Rules

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

7 Rules error 1 warn 6
View Rules File View on GitHub

Rule Categories

silverpop

Rules

warn
silverpop-operation-summary-title-case
All operation summaries must use Title Case.
$.paths[*][*].summary
warn
silverpop-operation-ids-camel-case
Operation IDs should use camelCase.
$.paths[*][*].operationId
warn
silverpop-tags-defined
All operations must include at least one tag.
$.paths[*][*]
warn
silverpop-description-required
All operations must have a description.
$.paths[*][*]
error
silverpop-response-200-required
All operations must define a 200 success response.
$.paths[*][*].responses
warn
silverpop-bearer-auth
Non-authentication operations must use BearerAuth.
$.paths[?([email protected](/oauth/))][*]
warn
silverpop-path-parameters-described
All path parameters must have descriptions.
$.paths[*][*].parameters[?(@.in == "path")]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  silverpop-operation-summary-title-case:
    description: All operation summaries must use Title Case.
    message: 'Summary "{{value}}" must use Title Case.'
    severity: warn
    given: '$.paths[*][*].summary'
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z][a-z]+(\s[A-Z][a-z]+)*$'

  silverpop-operation-ids-camel-case:
    description: Operation IDs should use camelCase.
    message: 'OperationId "{{value}}" should be camelCase.'
    severity: warn
    given: '$.paths[*][*].operationId'
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]+$'

  silverpop-tags-defined:
    description: All operations must include at least one tag.
    message: Operation must include at least one tag.
    severity: warn
    given: '$.paths[*][*]'
    then:
      field: tags
      function: defined

  silverpop-description-required:
    description: All operations must have a description.
    message: Operation must include a description.
    severity: warn
    given: '$.paths[*][*]'
    then:
      field: description
      function: defined

  silverpop-response-200-required:
    description: All operations must define a 200 success response.
    message: Operation must define a 200 response.
    severity: error
    given: '$.paths[*][*].responses'
    then:
      field: '200'
      function: defined

  silverpop-bearer-auth:
    description: Non-authentication operations must use BearerAuth.
    message: Operation must declare BearerAuth security.
    severity: warn
    given: '$.paths[?([email protected](/oauth/))][*]'
    then:
      field: security
      function: defined

  silverpop-path-parameters-described:
    description: All path parameters must have descriptions.
    message: Path parameter "{{value}}" must have a description.
    severity: warn
    given: '$.paths[*][*].parameters[?(@.in == "path")]'
    then:
      field: description
      function: defined