Amazon CloudFront · API Governance Rules

Amazon CloudFront API Rules

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

19 Rules error 12 warn 6 info 1
View Rules File View on GitHub

Rule Categories

get info microcks no operation parameter response schema security servers

Rules

error
info-title-prefix
API title must start with "Amazon CloudFront"
$.info.title
error
info-description-required
Info object must have a description
$.info
error
info-version-required
API must have a version
$.info
error
servers-required
API must define at least one server
$
error
servers-https-only
All server URLs must use HTTPS
$.servers[*].url
error
operation-operationId-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
operation-operationId-pascal-case
operationId must use PascalCase
$.paths[*][get,post,put,patch,delete].operationId
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-prefix
Operation summaries must start with "Amazon CloudFront"
$.paths[*][get,post,put,patch,delete].summary
error
operation-description-required
Every operation must have a description
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
Every operation must have tags
$.paths[*][get,post,put,patch,delete]
warn
parameter-description-required
All parameters must have descriptions
$.paths[*][get,post,put,patch,delete].parameters[*]
error
response-description-required
All response codes must have descriptions
$.paths[*][get,post,put,patch,delete].responses[*]
warn
response-500-required
Operations should document 500 internal server error
$.paths[*][get,post,put,patch,delete].responses
warn
schema-description-required
Top-level schemas should have descriptions
$.components.schemas[*]
warn
security-schemes-defined
Security schemes must be defined
$.components
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
error
no-empty-descriptions
Descriptions must not be empty
$..description
info
microcks-operation-present
Operations should have x-microcks-operation extension
$.paths[*][get,post,put,patch,delete]

Spectral Ruleset

Raw ↑
rules:
  info-title-prefix:
    description: API title must start with "Amazon CloudFront"
    severity: error
    given: "$.info.title"
    then:
      function: pattern
      functionOptions:
        match: "^Amazon CloudFront"
  info-description-required:
    description: Info object 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: API must define at least one server
    severity: error
    given: "$"
    then:
      field: servers
      function: truthy
  servers-https-only:
    description: All server URLs must use HTTPS
    severity: error
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "^https://"
  operation-operationId-required:
    description: Every operation must have an operationId
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy
  operation-operationId-pascal-case:
    description: operationId must use PascalCase
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z0-9]+$"
  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-prefix:
    description: Operation summaries must start with "Amazon CloudFront"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].summary"
    then:
      function: pattern
      functionOptions:
        match: "^Amazon CloudFront"
  operation-description-required:
    description: Every operation must have a description
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: description
      function: truthy
  operation-tags-required:
    description: Every operation must have tags
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy
  parameter-description-required:
    description: All parameters must have descriptions
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].parameters[*]"
    then:
      field: description
      function: truthy
  response-description-required:
    description: All response codes must have descriptions
    severity: error
    given: "$.paths[*][get,post,put,patch,delete].responses[*]"
    then:
      field: description
      function: truthy
  response-500-required:
    description: Operations should document 500 internal server error
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].responses"
    then:
      field: "500"
      function: truthy
  schema-description-required:
    description: Top-level schemas should have descriptions
    severity: warn
    given: "$.components.schemas[*]"
    then:
      field: description
      function: truthy
  security-schemes-defined:
    description: Security schemes must be defined
    severity: warn
    given: "$.components"
    then:
      field: securitySchemes
      function: truthy
  get-no-request-body:
    description: GET operations must not have a request body
    severity: error
    given: "$.paths[*].get"
    then:
      field: requestBody
      function: falsy
  no-empty-descriptions:
    description: Descriptions must not be empty
    severity: error
    given: "$..description"
    then:
      function: truthy
  microcks-operation-present:
    description: Operations should have x-microcks-operation extension
    severity: info
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: x-microcks-operation
      function: truthy