Amazon Global Accelerator · API Governance Rules

Amazon Global Accelerator API Rules

Spectral linting rules defining API design standards and conventions for Amazon Global Accelerator.

14 Rules error 7 warn 5 info 2
View Rules File View on GitHub

Rule Categories

info microcks no operation response schema security servers

Rules

warn
info-title-format
API title must reference Amazon Global Accelerator
$.info.title
error
info-description-required
API must have a description
$.info
error
info-version-required
API must have a version
$.info
error
servers-required
Servers must be defined
$
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-company-prefix
Operation summaries must start with Amazon Global Accelerator
$.paths[*][get,post,put,patch,delete].summary
error
operation-id-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
operation-description-required
Every operation must have a description
$.paths[*][get,post,put,patch,delete]
error
response-success-required
Operations must have at least one success response
$.paths[*][get,post,put,patch,delete].responses
warn
response-description-required
Responses must have descriptions
$.paths[*][get,post,put,patch,delete].responses[*]
warn
security-schemes-defined
Security schemes should be defined in components
$
info
schema-properties-typed
Schema properties should have types
$.components.schemas[*].properties[*]
error
no-empty-descriptions
Descriptions must not be empty
$..description
info
microcks-operation-extension
Operations should have x-microcks-operation
$.paths[*][get,post,put,patch,delete]

Spectral Ruleset

Raw ↑
rules:
  info-title-format:
    description: API title must reference Amazon Global Accelerator
    severity: warn
    given: "$.info.title"
    then:
      function: pattern
      functionOptions:
        match: "^Amazon Global Accelerator"

  info-description-required:
    description: API must have a description
    severity: error
    given: "$.info"
    then:
      field: description
      function: truthy

  info-version-required:
    description: API must have a version
    severity: error
    given: "$.info"
    then:
      field: version
      function: truthy

  servers-required:
    description: Servers must be defined
    severity: error
    given: "$"
    then:
      field: servers
      function: truthy

  operation-summary-required:
    description: Every operation must have a summary
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: summary
      function: truthy

  operation-summary-company-prefix:
    description: Operation summaries must start with Amazon Global Accelerator
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].summary"
    then:
      function: pattern
      functionOptions:
        match: "^Amazon Global Accelerator"

  operation-id-required:
    description: Every operation must have an operationId
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  operation-description-required:
    description: Every operation must have a description
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: description
      function: truthy

  response-success-required:
    description: Operations must have at least one success response
    severity: error
    given: "$.paths[*][get,post,put,patch,delete].responses"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          anyOf:
            - required: ["200"]
            - required: ["201"]
            - required: ["204"]

  response-description-required:
    description: Responses must have descriptions
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].responses[*]"
    then:
      field: description
      function: truthy

  security-schemes-defined:
    description: Security schemes should be defined in components
    severity: warn
    given: "$"
    then:
      field: components.securitySchemes
      function: truthy

  schema-properties-typed:
    description: Schema properties should have types
    severity: info
    given: "$.components.schemas[*].properties[*]"
    then:
      field: type
      function: truthy

  no-empty-descriptions:
    description: Descriptions must not be empty
    severity: error
    given: "$..description"
    then:
      function: pattern
      functionOptions:
        match: ".+"

  microcks-operation-extension:
    description: Operations should have x-microcks-operation
    severity: info
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: x-microcks-operation
      function: truthy