rules: # INFO / METADATA info-title-required: description: Info title must be defined. severity: error given: "$.info" then: field: title function: truthy info-description-required: description: Info description must be defined. severity: warn given: "$.info" then: field: description function: truthy info-version-required: description: Info version must be defined. severity: error given: "$.info" then: field: version function: truthy # OPENAPI VERSION openapi-version-3: description: OpenAPI version must be 3.x. severity: error given: "$" then: field: openapi function: pattern functionOptions: match: "^3\\." # SERVERS servers-defined: description: Servers must be defined. severity: error given: "$" then: field: servers function: truthy # PATHS — NAMING CONVENTIONS paths-api-v2-prefix: description: Stable API paths should start with /api/v2/. severity: info given: "$.paths[*]~" then: function: pattern functionOptions: match: "^(/api/v2/|/ui/)" paths-kebab-case: description: Path segments should use snake_case or kebab-case. severity: info given: "$.paths[*]~" then: function: pattern functionOptions: match: "^(/[a-z0-9_{}/-]+)+$" # OPERATIONS 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-description-required: description: Every operation should have a description. severity: warn given: "$.paths[*][get,post,put,patch,delete]" then: field: description function: truthy 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-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-summary-starts-with-airflow: description: Operation summaries should start with "Airflow". severity: info given: "$.paths[*][get,post,put,patch,delete].summary" then: function: pattern functionOptions: match: "^Airflow " # PARAMETERS parameter-description-required: description: All parameters should have a description. severity: warn given: "$.paths[*][get,post,put,patch,delete].parameters[*]" then: field: description function: truthy # RESPONSES response-success-required: description: Every operation must have at least one success response. severity: error given: "$.paths[*][get,post,put,patch,delete].responses" then: function: truthy response-description-required: description: All responses must have a description. severity: warn given: "$.paths[*][get,post,put,patch,delete].responses[*]" then: field: description function: truthy response-401-documented: description: Operations should document 401 Unauthorized responses. severity: info given: "$.paths[*][get,post,put,patch,delete].responses" then: function: truthy # SCHEMAS schema-description-recommended: description: Top-level schemas should have a description. severity: info given: "$.components.schemas[*]" then: field: description function: truthy schema-properties-snake-case: description: Schema property names should use snake_case. severity: info given: "$.components.schemas[*].properties[*]~" then: function: pattern functionOptions: match: "^[a-z][a-z0-9_]*$" # SECURITY security-schemes-defined: description: Security schemes should be defined. severity: warn given: "$.components" then: field: securitySchemes function: truthy # HTTP METHOD CONVENTIONS get-no-request-body: description: GET operations should not have a request body. severity: error given: "$.paths[*].get" then: field: requestBody function: falsy delete-returns-204: description: DELETE operations should return 204 No Content. severity: info given: "$.paths[*].delete.responses" then: function: truthy # GENERAL QUALITY no-empty-descriptions: description: Descriptions must not be empty strings. severity: warn given: "$..description" then: function: truthy microcks-operation-extension: description: Operations should include x-microcks-operation for mock compatibility. severity: info given: "$.paths[*][get,post,put,patch,delete]" then: field: x-microcks-operation function: truthy dag-resource-required: description: DAG endpoints are core to Airflow — they must be documented. severity: info given: "$.paths" then: function: truthy