extends: spectral:oas rules: wallarm-operation-ids-required: description: All operations must have an operationId severity: error given: "$.paths[*][*]" then: field: operationId function: truthy wallarm-operation-summary-title-case: description: Operation summaries must use Title Case severity: warn given: "$.paths[*][*].summary" then: function: pattern functionOptions: match: "^[A-Z][a-zA-Z0-9]*(\\s[A-Z][a-zA-Z0-9]*)*$" wallarm-operation-tags-required: description: All operations must have at least one tag severity: error given: "$.paths[*][*]" then: field: tags function: truthy wallarm-security-scheme-apikey: description: Operations must use the Wallarm API token security scheme severity: error given: "$.components.securitySchemes" then: field: ApiTokenAuth function: truthy wallarm-responses-defined: description: Operations must define at least a 200 and 401 response severity: warn given: "$.paths[*][*].responses" then: function: schema functionOptions: schema: type: object required: - "200" wallarm-request-body-content-type: description: POST/PUT request bodies must specify application/json content type severity: error given: "$.paths[*][post,put].requestBody.content" then: field: application/json function: truthy wallarm-v4-endpoints-paginated: description: v4 list endpoints should support pagination parameters severity: warn given: "$.paths['/v4/ip_rules'].get.parameters" then: function: schema functionOptions: schema: type: array contains: type: object properties: name: enum: - limit - offset wallarm-info-contact: description: Info object must have contact information severity: warn given: "$.info" then: field: contact function: truthy wallarm-info-description: description: Info object must have a description severity: error given: "$.info" then: field: description function: truthy wallarm-servers-defined: description: Both US and EU cloud servers must be defined severity: warn given: "$.servers" then: function: length functionOptions: min: 2 wallarm-schemas-defined: description: Components must define reusable schemas severity: warn given: "$.components" then: field: schemas function: truthy wallarm-response-schema-reference: description: Successful responses should reference a schema severity: warn given: "$.paths[*][*].responses['200'].content['application/json']" then: field: schema function: truthy