Amazon Clean Rooms · API Governance Rules

Amazon Clean Rooms API Rules

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

34 Rules error 14 warn 17 info 3
View Rules File View on GitHub

Rule Categories

delete get info microcks no openapi operation pagination parameter path paths query response schema security servers

Rules

error
info-title-prefix
API title must start with "Amazon Clean Rooms"
$.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
paths-kebab-case
Path segments should use kebab-case
$.paths[*]~
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 (AWS convention)
$.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 Clean Rooms"
$.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 at least one tag
$.paths[*][get,post,put,patch,delete]
warn
parameter-description-required
All parameters must have descriptions
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
parameter-camel-case
Path and query parameters should use camelCase (AWS convention)
$.paths[*][get,post,put,patch,delete].parameters[*].name
error
response-success-required
Every operation must have a 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-400-required
Operations should document 400 bad request
$.paths[*][post,put,patch].responses
warn
response-403-required
Operations should document 403 access denied
$.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-on-top-level
Top-level component schemas should have descriptions
$.components.schemas[*]
warn
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
delete-returns-200-or-204
DELETE operations should return 200 or 204
$.paths[*].delete.responses
error
no-empty-descriptions
Descriptions must not be empty strings
$..description
info
microcks-operation-present
Operations should have x-microcks-operation extension
$.paths[*][get,post,put,patch,delete]
info
pagination-uses-next-token
List operations should use nextToken for pagination (AWS convention)
$.paths[*].get.parameters[?(@.name == 'nextToken')]
warn
servers-expected-domain
Server URLs should be on the amazonaws.com domain.
$.servers[*].url
warn
path-params-casing
Path parameters should be camelCase (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
warn
query-params-casing
Query parameters should be camelCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
warn
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
info
schema-properties-casing
Schema properties should be camelCase (the dominant convention in this API).
$.components.schemas[*].properties

Spectral Ruleset

Raw ↑
# amazon-clean-rooms — 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: 100% of servers already https (error)
#   - servers-expected-domain: 1/1 servers on amazonaws.com
#   - path-params-casing: camel @ 100% (n=4)
#   - query-params-casing: camel @ 82% (n=11)
#   - operationid-casing: pascal @ 100% (n=10)
#   - schema-names-casing: pascal @ 100% (n=21)
#   - schema-properties-casing: camel @ 59% (n=64)
#   - security: global (root) — NOT emitting operation-security-required
#   - operation-documents-400: 100% adherence
#   - operation-documents-403: 100% adherence
#   - operation-documents-500: 100% adherence
#   - pagination params observed: ['maxResults', 'nextToken']
#   - merge: kept 29 existing, added 5 measured, upgraded 0
#   - added: servers-expected-domain, path-params-casing, query-params-casing, schema-names-casing, schema-properties-casing
extends:
  - spectral:oas
rules:
  info-title-prefix:
    description: API title must start with "Amazon Clean Rooms"
    severity: error
    given: $.info.title
    then:
      function: pattern
      functionOptions:
        match: ^Amazon Clean Rooms
  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:
    description: Must use OpenAPI 3.x
    severity: error
    given: $
    then:
      field: openapi
      function: pattern
      functionOptions:
        match: ^3\.
  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://
  paths-kebab-case:
    description: Path segments should use kebab-case
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: ^(/[a-z][a-zA-Z0-9-]*|/{[a-zA-Z][a-zA-Z0-9]*})*$
  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 (AWS convention)
    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 Clean Rooms"
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].summary
    then:
      function: pattern
      functionOptions:
        match: ^Amazon Clean Rooms
  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 at least one tag
    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
  parameter-camel-case:
    description: Path and query parameters should use camelCase (AWS convention)
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].parameters[*].name
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
  response-success-required:
    description: Every operation must have a 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-400-required:
    description: Operations should document 400 bad request
    severity: warn
    given: $.paths[*][post,put,patch].responses
    then:
      field: '400'
      function: truthy
  response-403-required:
    description: Operations should document 403 access denied
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].responses
    then:
      field: '403'
      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-on-top-level:
    description: Top-level component 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
  security-global-defined:
    description: Global security must be defined
    severity: warn
    given: $
    then:
      field: security
      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
  delete-returns-200-or-204:
    description: DELETE operations should return 200 or 204
    severity: warn
    given: $.paths[*].delete.responses
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
          - required:
            - '200'
          - required:
            - '204'
  no-empty-descriptions:
    description: Descriptions must not be empty strings
    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
  pagination-uses-next-token:
    description: List operations should use nextToken for pagination (AWS convention)
    severity: info
    given: $.paths[*].get.parameters[?(@.name == 'nextToken')]
    then:
      field: name
      function: truthy
  servers-expected-domain:
    description: Server URLs should be on the amazonaws.com domain.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: amazonaws\.com
  path-params-casing:
    description: Path parameters should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.paths[*].parameters[?(@.in=='path')].name
    then:
      function: casing
      functionOptions:
        type: camel
  query-params-casing:
    description: Query parameters should be camelCase (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: camel
  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 camelCase (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: camel