Deliveroo · API Governance Rules

Deliveroo API Rules

Spectral linting rules defining API design standards and conventions for Deliveroo.

6 Rules warn 6
View Rules File View on GitHub

Rule Categories

channel message no operation

Rules

warn
channel-key-casing
Channel names should be kebab-case (the dominant convention in this API).
$.channels
warn
message-name-casing
Message names should be PascalCase (the dominant convention in this API).
$.components.messages
warn
operation-id-casing
Operation IDs should be camelCase (the dominant convention in this API).
$.channels[*][publish,subscribe].operationId
warn
message-contenttype-defined
Messages should declare a contentType (set on 100% of this API's messages).
$.components.messages[*]
warn
message-payload-defined
Messages should define a payload schema (set on 100% of this API's messages).
$.components.messages[*]
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description

Spectral Ruleset

Raw ↑
# deliveroo — 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:
#   - channel-key-casing: kebab @ 100% (n=3)
#   - message-name-casing: pascal @ 100% (n=3)
#   - operation-id-casing: camel @ 100% (n=3, v2)
#   - message-contenttype-defined: 100% adherence
#   - message-payload-defined: 100% adherence
extends:
  - spectral:asyncapi
rules:
  channel-key-casing:
    description: Channel names should be kebab-case (the dominant convention in this API).
    severity: warn
    given: $.channels
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: kebab
  message-name-casing:
    description: Message names should be PascalCase (the dominant convention in this API).
    severity: warn
    given: $.components.messages
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: pascal
  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
  message-contenttype-defined:
    description: Messages should declare a contentType (set on 100% of this API's messages).
    severity: warn
    given: $.components.messages[*]
    then:
      field: contentType
      function: truthy
  message-payload-defined:
    description: Messages should define a payload schema (set on 100% of this API's messages).
    severity: warn
    given: $.components.messages[*]
    then:
      field: payload
      function: truthy
  no-empty-descriptions:
    description: Descriptions must not be empty strings.
    severity: warn
    given: $..description
    then:
      function: truthy