Apache Airflow · API Governance Rules

Apache Airflow API Rules

Spectral linting rules defining API design standards and conventions for Apache Airflow.

19 Rules error 8 warn 9 info 2
View Rules File View on GitHub

Rule Categories

delete get info operation parameter paths response schema security servers tag

Rules

warn
info-title-prefix
API title must start with "Apache Airflow"
$.info.title
error
info-description-required
API must have a description.
$.info
error
info-version-required
API info must include a version.
$.info
error
servers-defined
At least one server must be defined.
$
error
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-starts-with-apache-airflow
Operation summaries must start with "Apache Airflow".
$.paths[*][get,post,put,patch,delete].summary
error
operation-operationId-required
Every operation must have an operationId.
$.paths[*][get,post,put,patch,delete]
warn
operation-operationId-camelCase
operationId must be camelCase.
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-tags-required
Every operation must have at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
operation-description-required
Every operation should have a description.
$.paths[*][get,post,put,patch,delete]
warn
paths-kebab-case
Path segments must use kebab-case.
$.paths
warn
parameter-description-required
Every parameter must have a description.
$.paths[*][get,post,put,patch,delete].parameters[*]
error
response-success-required
Every operation must define at least one 2xx response.
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
Every response must have a description.
$.paths[*][get,post,put,patch,delete].responses[*]
info
schema-property-description
Schema properties should have descriptions.
$.components.schemas[*].properties[*]
warn
security-schemes-defined
Security schemes must be defined in components.
$.components
error
get-no-request-body
GET operations must not have a request body.
$.paths[*].get
warn
delete-no-request-body
DELETE operations should not have a request body.
$.paths[*].delete
info
tag-description-required
Global tags should have descriptions.
$.tags[*]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  info-title-prefix:
    description: API title must start with "Apache Airflow"
    severity: warn
    given: "$.info.title"
    then:
      function: pattern
      functionOptions:
        match: "^Apache Airflow"
  info-description-required:
    description: API must have a description.
    severity: error
    given: "$.info"
    then:
      field: description
      function: truthy
  info-version-required:
    description: API info must include a version.
    severity: error
    given: "$.info"
    then:
      field: version
      function: truthy
  servers-defined:
    description: At least one server must be defined.
    severity: error
    given: "$"
    then:
      field: servers
      function: truthy
  operation-summary-required:
    description: Every operation must have a summary.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: summary
      function: truthy
  operation-summary-starts-with-apache-airflow:
    description: Operation summaries must start with "Apache Airflow".
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].summary"
    then:
      function: pattern
      functionOptions:
        match: "^Apache Airflow"
  operation-operationId-required:
    description: Every operation must have an operationId.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy
  operation-operationId-camelCase:
    description: operationId must be camelCase.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"
  operation-tags-required:
    description: Every operation must have at least one tag.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy
  operation-description-required:
    description: Every operation should have a description.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: description
      function: truthy
  paths-kebab-case:
    description: Path segments must use kebab-case.
    severity: warn
    given: "$.paths"
    then:
      function: pattern
      functionOptions:
        match: "^(/[a-z0-9{}_\\-]+)+$"
  parameter-description-required:
    description: Every parameter must have a description.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].parameters[*]"
    then:
      field: description
      function: truthy
  response-success-required:
    description: Every operation must define at least one 2xx response.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete].responses"
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
            - required: ['200']
            - required: ['201']
            - required: ['204']
  response-description-required:
    description: Every response must have a description.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete].responses[*]"
    then:
      field: description
      function: truthy
  schema-property-description:
    description: Schema properties should have descriptions.
    severity: info
    given: "$.components.schemas[*].properties[*]"
    then:
      field: description
      function: truthy
  security-schemes-defined:
    description: Security schemes must be defined in components.
    severity: warn
    given: "$.components"
    then:
      field: securitySchemes
      function: truthy
  get-no-request-body:
    description: GET operations must not have a request body.
    severity: error
    given: "$.paths[*].get"
    then:
      field: requestBody
      function: falsy
  delete-no-request-body:
    description: DELETE operations should not have a request body.
    severity: warn
    given: "$.paths[*].delete"
    then:
      field: requestBody
      function: falsy
  tag-description-required:
    description: Global tags should have descriptions.
    severity: info
    given: "$.tags[*]"
    then:
      field: description
      function: truthy