rules: # INFO / METADATA info-title-required: description: API info title must be present. severity: error given: $.info then: field: title function: truthy info-description-required: description: API info description must be present and meaningful. severity: warn given: $.info then: field: description function: truthy info-version-required: description: API version must be defined. severity: error given: $.info then: field: version function: truthy info-license-required: description: Open data APIs should include a license. severity: warn given: $.info then: field: license function: truthy # OPENAPI VERSION openapi-version-3: description: Must use OpenAPI 3.0.x. severity: error given: $ then: field: openapi function: pattern functionOptions: match: "^3\\.0\\." # SERVERS servers-must-be-defined: description: Servers array must be defined. severity: error given: $ then: field: servers function: truthy servers-description-required: description: Each server should have a description. severity: warn given: $.servers[*] then: field: description function: truthy # 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: error given: $.paths[*][get,post,put,patch,delete] then: field: tags function: truthy # RESPONSES 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: type: object minProperties: 1 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 # SCHEMAS schema-description-required: description: Component schemas should have descriptions. severity: warn given: $.components.schemas[*] then: field: description function: truthy schema-type-required: description: Schemas should define a type. severity: warn given: $.components.schemas[*] then: field: type function: truthy schema-properties-described: description: Schema properties should have descriptions. severity: info given: $.components.schemas[*].properties[*] then: field: description function: truthy # HTTP METHOD CONVENTIONS get-no-request-body: description: GET operations must not have a request body. severity: error given: $.paths[*].get then: field: requestBody function: falsy # GENERAL QUALITY no-empty-descriptions: description: Descriptions must not be empty strings. severity: warn given: $..description then: function: truthy tags-defined: description: Global tags array should be defined for documentation. severity: info given: $ then: field: tags function: truthy