Traiana · API Governance Rules

Traiana API Rules

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

16 Rules error 9 warn 7
View Rules File View on GitHub

Rule Categories

info operation parameter paths response security 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
servers-https-only
$.servers[*].url
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
paths-use-kebab-case
$.paths
warn
parameter-description-required
$.paths[*][*].parameters[*]
warn
security-schemes-defined
$.components.securitySchemes

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: "^Traiana "}}
  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}
  servers-https-only:
    severity: error
    given: $.servers[*].url
    then: {function: pattern, functionOptions: {match: "^https://"}}
  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}
  paths-use-kebab-case:
    severity: warn
    given: $.paths
    then: {field: "@key", function: pattern, functionOptions: {match: "^\\/[a-z0-9\\-\\/{]"}}
  parameter-description-required:
    severity: warn
    given: $.paths[*][*].parameters[*]
    then: {field: description, function: truthy}
  security-schemes-defined:
    severity: warn
    given: $.components.securitySchemes
    then: {function: truthy}