Estated · API Governance Rules

Estated API Rules

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

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

Rule Categories

estated

Rules

warn
estated-title-case-summary
Operation summaries must use Title Case.
$.paths.*.*.summary
warn
estated-operation-id-camel
operationId must be camelCase.
$.paths.*.*.operationId
warn
estated-snake-case-property
Estated response properties use snake_case throughout.
$.components.schemas..properties[*]~
error
estated-token-required
Every operation must list `token` as a required query parameter.
$.paths.*.get

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  estated-title-case-summary:
    description: Operation summaries must use Title Case.
    message: "{{property}} should be Title Case"
    severity: warn
    given: "$.paths.*.*.summary"
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-zA-Z0-9]*)(\\s+[A-Z][a-zA-Z0-9]*)*$"
  estated-operation-id-camel:
    description: operationId must be camelCase.
    message: "{{property}} should be camelCase"
    severity: warn
    given: "$.paths.*.*.operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"
  estated-snake-case-property:
    description: Estated response properties use snake_case throughout.
    message: "{{property}} should be snake_case"
    severity: warn
    given: "$.components.schemas..properties[*]~"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-z0-9_]*$"
  estated-token-required:
    description: Every operation must list `token` as a required query parameter.
    severity: error
    given: "$.paths.*.get"
    then:
      field: parameters
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            type: object
            properties:
              name: { const: token }
              in: { const: query }
              required: { const: true }