Amazon Polly · API Governance Rules

Amazon Polly API Rules

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

26 Rules error 12 warn 11 info 3
View Rules File View on GitHub

Rule Categories

get info no openapi operation operationid parameter paths query response schema security servers

Rules

warn
info-title-contains-amazon-polly
API title must reference Amazon Polly
$.info.title
error
info-description-required
API must have a description
$.info
error
info-version-required
API version must be defined
$.info
error
openapi-version-3
API should use OpenAPI 3.x
$.openapi
error
servers-defined
Servers must be defined
$
warn
servers-https
All server URLs must use HTTPS
$.servers[*].url
info
paths-kebab-case
Path segments must use kebab-case or camelCase
$.paths
info
paths-v1-prefix
All paths should start with /v1/
$.paths
error
operation-summary-required
All operations must have a summary
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-amazon-polly-prefix
Summaries must begin with 'Amazon Polly'
$.paths[*][get,post,put,patch,delete].summary
error
operation-description-required
All operations must have a description
$.paths[*][get,post,put,patch,delete]
error
operation-id-required
All operations must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
operation-tags-required
All operations must have tags
$.paths[*][get,post,put,patch,delete]
error
parameter-description-required
All parameters must have descriptions
$.paths[*][*].parameters[*]
error
response-success-required
All operations must have a success response
$.paths[*][get,post,put,patch,delete]
error
response-description-required
All responses must have descriptions
$.paths[*][*].responses[*]
warn
schema-type-defined
Schemas must define a type
$.components.schemas[*]
error
security-schemes-defined
Security schemes must be defined
$.components
warn
security-global-defined
Global security must be defined
$
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
warn
no-empty-descriptions
Descriptions must not be empty strings
$..description
info
operation-examples-encouraged
Operations should provide examples
$.paths[*][*].responses[*].content[*]
warn
query-params-casing
Query parameters should be PascalCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
warn
operationid-casing
Operation IDs should be PascalCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].operationId
warn
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
warn
schema-properties-casing
Schema properties should be PascalCase (the dominant convention in this API).
$.components.schemas[*].properties

Spectral Ruleset

Raw ↑
# amazon-polly — Spectral ruleset (strengthened)
# Plain Spectral. Existing hand-authored rules preserved; measured rules added
# from this provider's own OpenAPI conventions by strengthen_ruleset.py,
# then self-validated against the spec.
#
# Provenance:
#   - servers-https-only: 60% of servers already https (warn)
#   - path-params-casing: pascal @ 100% (n=7)
#   - query-params-casing: pascal @ 100% (n=10)
#   - operationid-casing: pascal @ 100% (n=15)
#   - schema-names-casing: pascal @ 100% (n=85)
#   - schema-properties-casing: pascal @ 100% (n=80)
#   - security: global (root) — NOT emitting operation-security-required
#   - merge: kept 22 existing, added 4 measured, upgraded 0
#   - added: query-params-casing, operationid-casing, schema-names-casing, schema-properties-casing
extends:
  - spectral:oas
rules:
  info-title-contains-amazon-polly:
    description: API title must reference Amazon Polly
    message: Info title should contain 'Amazon Polly'
    severity: warn
    given: $.info.title
    then:
      function: pattern
      functionOptions:
        match: Amazon Polly
  info-description-required:
    description: API must have a description
    message: Info object must have a description
    severity: error
    given: $.info
    then:
      field: description
      function: truthy
  info-version-required:
    description: API version must be defined
    message: Info object must have a version
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  openapi-version-3:
    description: API should use OpenAPI 3.x
    message: Spec must use OpenAPI 3.0 or higher
    severity: error
    given: $.openapi
    then:
      function: pattern
      functionOptions:
        match: ^3\.
  servers-defined:
    description: Servers must be defined
    message: At least one server must be defined
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  servers-https:
    description: All server URLs must use HTTPS
    message: Server URL must use HTTPS
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https
  paths-kebab-case:
    description: Path segments must use kebab-case or camelCase
    message: Path segments must use lowercase characters
    severity: info
    given: $.paths
    then:
      field: '@key'
      function: pattern
      functionOptions:
        match: ^(/[a-zA-Z0-9{}_/-]+)+$
  paths-v1-prefix:
    description: All paths should start with /v1/
    message: Paths should be prefixed with /v1/
    severity: info
    given: $.paths
    then:
      field: '@key'
      function: pattern
      functionOptions:
        match: ^/v1/
  operation-summary-required:
    description: All operations must have a summary
    message: Operation must have a summary
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: summary
      function: truthy
  operation-summary-amazon-polly-prefix:
    description: Summaries must begin with 'Amazon Polly'
    message: Operation summary must start with 'Amazon Polly'
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].summary
    then:
      function: pattern
      functionOptions:
        match: ^Amazon Polly
  operation-description-required:
    description: All operations must have a description
    message: Operation must have a description
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: description
      function: truthy
  operation-id-required:
    description: All operations must have an operationId
    message: Operation must have an operationId
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: operationId
      function: truthy
  operation-tags-required:
    description: All operations must have tags
    message: Operation must have at least one tag
    severity: warn
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: tags
      function: truthy
  parameter-description-required:
    description: All parameters must have descriptions
    message: Parameter must have a description
    severity: error
    given: $.paths[*][*].parameters[*]
    then:
      field: description
      function: truthy
  response-success-required:
    description: All operations must have a success response
    message: Operation must define at least one 2xx response
    severity: error
    given: $.paths[*][get,post,put,patch,delete]
    then:
      field: responses
      function: truthy
  response-description-required:
    description: All responses must have descriptions
    message: Response must have a description
    severity: error
    given: $.paths[*][*].responses[*]
    then:
      field: description
      function: truthy
  schema-type-defined:
    description: Schemas must define a type
    message: Schema must have a type defined
    severity: warn
    given: $.components.schemas[*]
    then:
      field: type
      function: truthy
  security-schemes-defined:
    description: Security schemes must be defined
    message: Components must define securitySchemes
    severity: error
    given: $.components
    then:
      field: securitySchemes
      function: truthy
  security-global-defined:
    description: Global security must be defined
    message: Global security requirements should be defined
    severity: warn
    given: $
    then:
      field: security
      function: truthy
  get-no-request-body:
    description: GET operations must not have a request body
    message: 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 strings
    message: Description must not be empty
    severity: warn
    given: $..description
    then:
      function: truthy
  operation-examples-encouraged:
    description: Operations should provide examples
    message: Consider adding examples to operation responses
    severity: info
    given: $.paths[*][*].responses[*].content[*]
    then:
      field: examples
      function: truthy
  query-params-casing:
    description: Query parameters should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
    then:
      field: name
      function: casing
      functionOptions:
        type: pascal
  operationid-casing:
    description: Operation IDs should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].operationId
    then:
      function: casing
      functionOptions:
        type: pascal
  schema-names-casing:
    description: Component schema names should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.components.schemas
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: pascal
  schema-properties-casing:
    description: Schema properties should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: pascal