extends: - spectral:oas # Spectral linting rules for any Cloud Storage / Data Acquisition # API in this topic profile. These rules apply to ingestion, # transfer, and storage REST APIs and enforce baseline hygiene # expected of high-throughput data plane services. rules: csda-info-contact: description: API contact information must be present. severity: error given: "$.info" then: field: contact function: truthy csda-info-license: description: API license must be declared. severity: warn given: "$.info" then: field: license function: truthy csda-server-https: description: All server URLs must use HTTPS. severity: error given: "$.servers[*].url" then: function: pattern functionOptions: match: "^https://" csda-security-required: description: A security scheme must be defined. severity: error given: "$.components.securitySchemes" then: function: truthy csda-operation-tags: description: Every operation must declare at least one tag. severity: warn given: "$.paths[*][get,post,put,patch,delete]" then: field: tags function: schema functionOptions: schema: type: array minItems: 1 csda-operation-summary: description: Every operation must include a short summary. severity: warn given: "$.paths[*][get,post,put,patch,delete]" then: field: summary function: truthy csda-operation-id: description: Every operation must declare a unique operationId. severity: error given: "$.paths[*][get,post,put,patch,delete]" then: field: operationId function: truthy csda-error-responses: description: Mutating operations should declare 4xx error responses. severity: warn given: "$.paths[*][post,put,patch,delete].responses" then: function: schema functionOptions: schema: type: object anyOf: - required: ["400"] - required: ["401"] - required: ["403"] - required: ["404"] - required: ["422"] csda-pagination-tokens: description: List endpoints should support a continuation/page token. severity: info given: "$.paths[?(@property.match(/list$|jobs$|datasets$|buckets$|objects$/))].get.parameters[*].name" then: function: enumeration functionOptions: values: - pageToken - nextToken - continuation-token - marker - cursor - limit - maxResults - prefix