Amazon EventBridge · API Governance Rules

Amazon EventBridge API Rules

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

4 Rules error 1 warn 2 info 1
View Rules File View on GitHub

Rule Categories

no operation payload server

Rules

error
server-secure-protocol
Servers should use a secure protocol (this API's convention).
$.servers[*].protocol
info
payload-property-casing
Message payload properties should be snake_case (the dominant convention in this API).
$.components.schemas[*].properties
warn
operation-id-casing
Operation IDs should be camelCase (the dominant convention in this API).
$.channels[*][publish,subscribe].operationId
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# amazon-eventbridge — AsyncAPI Spectral ruleset (strengthened)
# Plain Spectral. Rules measured from this provider's own AsyncAPI event
# conventions by strengthen_asyncapi.py, then self-validated against the spec.
#
# Provenance:
#   - server-secure-protocol: 100% of servers already secure
#   - payload-property-casing: snake @ 89% (n=36)
#   - operation-id-casing: camel @ 100% (n=8, v2)
extends:
  - spectral:asyncapi
rules:
  server-secure-protocol:
    description: Servers should use a secure protocol (this API's convention).
    severity: error
    given: $.servers[*].protocol
    then:
      function: pattern
      functionOptions:
        match: ^(amqps|https|ibmmq|jms|kafka-secure|mqtts|secure-mqtt|stomps|wss)$
  payload-property-casing:
    description: Message payload properties should be snake_case (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: snake
  operation-id-casing:
    description: Operation IDs should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.channels[*][publish,subscribe].operationId
    then:
      function: casing
      functionOptions:
        type: camel
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy