Traefik · API Governance Rules

Traefik API Rules

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

16 Rules error 8 warn 8
View Rules File View on GitHub

Rule Categories

get info operation parameter path paths response schema servers

Rules

error
info-title-required
$.info
warn
info-title-format
$.info.title
error
info-description-required
$.info
error
info-version-required
$.info
error
servers-defined
$
error
paths-no-trailing-slash
$.paths
error
operation-operationId-required
$.paths[*][*]
error
operation-summary-required
$.paths[*][*]
warn
operation-summary-title-case
$.paths[*][*].summary
warn
operation-description-required
$.paths[*][*]
warn
operation-tags-required
$.paths[*][*]
error
response-200-defined
$.paths[*][get]
warn
path-name-pattern
$.paths
warn
parameter-description-required
$.paths[*][*].parameters[*]
warn
schema-description-required
$.components.schemas[*]
warn
get-responses-json
$.paths[*].get.responses[200].content

Spectral Ruleset

Raw ↑
rules:
  info-title-required:
    severity: error
    given: $.info
    then: {field: title, function: truthy}
  info-title-format:
    severity: warn
    given: $.info.title
    then: {function: pattern, functionOptions: {match: "^Traefik "}}
  info-description-required:
    severity: error
    given: $.info
    then: {field: description, function: truthy}
  info-version-required:
    severity: error
    given: $.info
    then: {field: version, function: truthy}
  servers-defined:
    severity: error
    given: $
    then: {field: servers, function: truthy}
  paths-no-trailing-slash:
    severity: error
    given: $.paths
    then: {field: "@key", function: pattern, functionOptions: {notMatch: "\\/$"}}
  operation-operationId-required:
    severity: error
    given: $.paths[*][*]
    then: {field: operationId, function: truthy}
  operation-summary-required:
    severity: error
    given: $.paths[*][*]
    then: {field: summary, function: truthy}
  operation-summary-title-case:
    severity: warn
    given: $.paths[*][*].summary
    then: {function: pattern, functionOptions: {match: "^[A-Z][a-z]"}}
  operation-description-required:
    severity: warn
    given: $.paths[*][*]
    then: {field: description, function: truthy}
  operation-tags-required:
    severity: warn
    given: $.paths[*][*]
    then: {field: tags, function: truthy}
  response-200-defined:
    severity: error
    given: $.paths[*][get]
    then: {field: responses, function: truthy}
  path-name-pattern:
    severity: warn
    given: $.paths
    then: {field: "@key", function: pattern, functionOptions: {match: "^\\/[a-z\\/{]"}}
  parameter-description-required:
    severity: warn
    given: $.paths[*][*].parameters[*]
    then: {field: description, function: truthy}
  schema-description-required:
    severity: warn
    given: $.components.schemas[*]
    then: {field: description, function: truthy}
  get-responses-json:
    severity: warn
    given: $.paths[*].get.responses[200].content
    then: {field: "application/json", function: truthy}