StatsD · API Governance Rules

StatsD API Rules

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

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 camelCase (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 names should be camelCase (the dominant convention in this API).
$.operations
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 ↑
# statsd — 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: camel @ 100% (n=4)
#   - message-name-casing: pascal @ 100% (n=15)
#   - operation-id-casing: camel @ 100% (n=4, v3)
#   - message-contenttype-defined: 100% adherence
#   - message-payload-defined: 100% adherence
extends:
  - spectral:asyncapi
rules:
  channel-key-casing:
    description: Channel names should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.channels
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: camel
  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 names should be camelCase (the dominant convention in this API).
    severity: warn
    given: $.operations
    then:
      field: '@key'
      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