extends: spectral:oas rules: cwms-operation-ids-camel-case: description: Operation IDs must use camelCase naming message: Operation ID "{{value}}" should use camelCase (e.g., getTimeSeries, getLocations) severity: warn given: "$.paths[*][*].operationId" then: function: pattern functionOptions: match: "^[a-z][a-zA-Z0-9]*$" cwms-operations-have-summaries: description: All operations must have a summary message: Operation is missing a summary severity: error given: "$.paths[*][get,post,put,patch,delete]" then: field: summary function: truthy cwms-operations-have-tags: description: All operations should be tagged for grouping message: Operation is missing tags severity: warn given: "$.paths[*][get,post,put,patch,delete]" then: field: tags function: truthy cwms-office-param-described: description: Office parameter should have a description explaining valid values message: Query parameter 'office' should have a description severity: info given: "$.paths[*][*].parameters[?(@.name == 'office')]" then: field: description function: truthy cwms-response-200-defined: description: All GET operations should define a 200 response message: GET operation is missing a 200 OK response definition severity: warn given: "$.paths[*][get]" then: field: responses.200 function: truthy cwms-servers-defined: description: API must define servers for base URL message: No servers defined in the API specification severity: error given: "$" then: field: servers function: truthy cwms-info-contact-present: description: API should have contact information message: API info is missing contact details severity: warn given: "$.info" then: field: contact function: truthy cwms-tags-title-case: description: Tags must use Title Case naming message: Tag "{{value}}" should use Title Case severity: warn given: "$.tags[*].name" then: function: pattern functionOptions: match: "^[A-Z][a-zA-Z0-9 &]*$" cwms-time-params-iso8601: description: Time parameters should specify ISO 8601 format message: Time parameter should specify format in description severity: info given: "$.paths[*][*].parameters[?(@.name == 'begin' || @.name == 'end')]" then: field: description function: truthy cwms-path-lowercase: description: API paths should use lowercase message: Path should be lowercase severity: warn given: "$.paths" then: function: pattern functionOptions: match: "^[a-z\\/\\{\\}\\-]*$"