Convex · API Governance Rules

Convex API Rules

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

4 Rules warn 3 info 1
View Rules File View on GitHub

Rule Categories

message no payload

Rules

warn
message-name-casing
Message names should be PascalCase (the dominant convention in this API).
$.components.messages
info
payload-property-casing
Message payload properties should be camelCase (the dominant convention in this API).
$.components.schemas[*].properties
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 ↑
# convex — 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:
#   - message-name-casing: pascal @ 100% (n=13)
#   - payload-property-casing: camel @ 52% (n=139)
#   - message-payload-defined: 100% adherence
extends:
  - spectral:asyncapi
rules:
  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
  payload-property-casing:
    description: Message payload properties should be camelCase (the dominant convention in this API).
    severity: info
    given: $.components.schemas[*].properties
    then:
      field: '@key'
      function: casing
      functionOptions:
        type: camel
  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