DreamFactory · API Governance Rules

DreamFactory API Rules

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

3 Rules warn 3
View Rules File View on GitHub

Rule Categories

no operation payload

Rules

warn
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 ↑
# dreamfactory — 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:
#   - payload-property-casing: snake @ 100% (n=8)
#   - operation-id-casing: camel @ 100% (n=10, v2)
extends:
  - spectral:asyncapi
rules:
  payload-property-casing:
    description: Message payload properties should be snake_case (the dominant convention in this API).
    severity: warn
    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