Amazon Certificate Manager · API Governance Rules

Amazon Certificate Manager API Rules

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

29 Rules error 15 warn 11 info 3
View Rules File View on GitHub

Rule Categories

delete external get info microcks no openapi operation parameter request response schema security servers

Rules

error
info-title-prefix
API title must start with "Amazon Certificate Manager"
$.info.title
error
info-description-required
Info object must have a description
$.info
error
info-version-required
API must have a version
$.info
warn
info-contact-required
API must have contact information
$.info
error
openapi-version
Must use OpenAPI 3.x
$
error
servers-required
API must define at least one server
$
error
servers-https-only
All server URLs must use HTTPS
$.servers[*].url
warn
servers-description-required
All servers must have a description
$.servers[*]
error
operation-operationId-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-operationId-pascal-case
operationId must use PascalCase (matches AWS convention)
$.paths[*][get,post,put,patch,delete,head,options].operationId
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-summary-prefix
Operation summaries must start with "Amazon Certificate Manager"
$.paths[*][get,post,put,patch,delete,head,options].summary
error
operation-description-required
Every operation must have a description
$.paths[*][get,post,put,patch,delete,head,options]
error
operation-tags-required
Every operation must have at least one tag
$.paths[*][get,post,put,patch,delete,head,options]
warn
parameter-description-required
All parameters must have descriptions
$.paths[*][get,post,put,patch,delete].parameters[*]
error
parameter-schema-required
All parameters must have a schema
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
request-body-json-content
Request bodies should use application/json content type
$.paths[*][post,put,patch].requestBody.content
error
response-success-required
Every operation must have a 2xx success response
$.paths[*][get,post,put,patch,delete]
error
response-description-required
All response codes must have descriptions
$.paths[*][get,post,put,patch,delete].responses[*]
warn
response-401-for-secured
Operations should include 400 bad request response
$.paths[*][post,put,patch,delete].responses
info
response-500-required
Operations should document 500 internal server error
$.paths[*][get,post,put,patch,delete].responses
warn
schema-description-on-top-level
Top-level component schemas should have descriptions
$.components.schemas[*]
warn
schema-properties-have-types
Schema properties must define a type
$.components.schemas[*].properties[*]
warn
security-schemes-defined
Security schemes must be defined if security is referenced
$.components
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
warn
delete-no-request-body
DELETE operations should not have a request body
$.paths[*].delete
error
no-empty-descriptions
Descriptions must not be empty strings
$..description
info
external-docs-encouraged
APIs should have external documentation links
$
info
microcks-operation-present
Operations should have x-microcks-operation extension for mock server support
$.paths[*][get,post,put,patch,delete]

Spectral Ruleset

Raw ↑
rules:
  # INFO / METADATA
  info-title-prefix:
    description: API title must start with "Amazon Certificate Manager"
    severity: error
    given: "$.info.title"
    then:
      function: pattern
      functionOptions:
        match: "^Amazon Certificate Manager"

  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

  info-contact-required:
    description: API must have contact information
    severity: warn
    given: "$.info"
    then:
      field: contact
      function: truthy

  # OPENAPI VERSION
  openapi-version:
    description: Must use OpenAPI 3.x
    severity: error
    given: "$"
    then:
      field: openapi
      function: pattern
      functionOptions:
        match: "^3\\."

  # SERVERS
  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://"

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

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

  operation-operationId-pascal-case:
    description: operationId must use PascalCase (matches AWS convention)
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete,head,options].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,head,options]"
    then:
      field: summary
      function: truthy

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

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

  operation-tags-required:
    description: Every operation must have at least one tag
    severity: error
    given: "$.paths[*][get,post,put,patch,delete,head,options]"
    then:
      field: tags
      function: truthy

  # PARAMETERS
  parameter-description-required:
    description: All parameters must have descriptions
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].parameters[*]"
    then:
      field: description
      function: truthy

  parameter-schema-required:
    description: All parameters must have a schema
    severity: error
    given: "$.paths[*][get,post,put,patch,delete].parameters[*]"
    then:
      field: schema
      function: truthy

  # REQUEST BODIES
  request-body-json-content:
    description: Request bodies should use application/json content type
    severity: warn
    given: "$.paths[*][post,put,patch].requestBody.content"
    then:
      field: application/json
      function: truthy

  # RESPONSES
  response-success-required:
    description: Every operation must have a 2xx success response
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: responses
      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-401-for-secured:
    description: Operations should include 400 bad request response
    severity: warn
    given: "$.paths[*][post,put,patch,delete].responses"
    then:
      field: "400"
      function: truthy

  response-500-required:
    description: Operations should document 500 internal server error
    severity: info
    given: "$.paths[*][get,post,put,patch,delete].responses"
    then:
      field: "500"
      function: truthy

  # SCHEMAS
  schema-description-on-top-level:
    description: Top-level component schemas should have descriptions
    severity: warn
    given: "$.components.schemas[*]"
    then:
      field: description
      function: truthy

  schema-properties-have-types:
    description: Schema properties must define a type
    severity: warn
    given: "$.components.schemas[*].properties[*]"
    then:
      field: type
      function: truthy

  # SECURITY
  security-schemes-defined:
    description: Security schemes must be defined if security is referenced
    severity: warn
    given: "$.components"
    then:
      field: securitySchemes
      function: truthy

  # HTTP METHOD CONVENTIONS
  get-no-request-body:
    description: GET operations must not have a request body
    severity: error
    given: "$.paths[*].get"
    then:
      field: requestBody
      function: falsy

  delete-no-request-body:
    description: DELETE operations should not have a request body
    severity: warn
    given: "$.paths[*].delete"
    then:
      field: requestBody
      function: falsy

  # GENERAL QUALITY
  no-empty-descriptions:
    description: Descriptions must not be empty strings
    severity: error
    given: "$..description"
    then:
      function: truthy

  external-docs-encouraged:
    description: APIs should have external documentation links
    severity: info
    given: "$"
    then:
      field: externalDocs
      function: truthy

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