--- # Spectral ruleset encoding observed patterns in the UC Davis CAES PEAKS API. # Derived from https://peaks.ucdavis.edu/swagger/v1/swagger.json (OpenAPI 3.0.1). formats: - oas3 rules: peaks-info-title: description: API info object must carry a title. severity: error given: $.info then: field: title function: truthy peaks-info-contact: description: PEAKS publishes an Application Support contact; require a contact object. severity: warn given: $.info then: field: contact function: truthy peaks-apikey-security: description: PEAKS authenticates via an X-Auth-Token API key header; an apiKey security scheme should be defined. severity: warn given: $.components.securitySchemes then: field: ApiKey function: truthy peaks-paths-team-scoped: description: PEAKS resource paths are team-scoped and must include the {teamName} path parameter. severity: warn given: $.paths[?(@property.match(/^\/api\//))]~ then: function: pattern functionOptions: match: "\\{teamName\\}" peaks-operation-tags: description: Every operation should be tagged to its resource group (access, keys, equipment, people, spaces, workstations, documents). severity: warn given: $.paths[*][get,post] then: field: tags function: truthy peaks-operation-responses: description: Every operation must declare responses. severity: error given: $.paths[*][get,post] then: field: responses function: truthy