extends: spectral:oas rules: spg-summary-title-case: description: All operation summaries must use Title Case message: "Operation summary '{{value}}' 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]*)*$" spg-tags-title-case: description: All tags must use Title Case message: "Tag '{{value}}' must use Title Case" severity: warn given: "$.paths[*][*].tags[*]" then: function: pattern functionOptions: match: "^[A-Z][a-zA-Z0-9 &]*$" spg-bearer-auth-required: description: All non-auth operations must use Bearer token authentication message: "Operations must use Bearer authentication" severity: error given: "$.paths[?(!@ == '/auth/api')][get,post,put,patch,delete]" then: field: security function: truthy spg-operation-ids-camel-case: description: Operation IDs must use camelCase message: "Operation ID '{{value}}' must use camelCase" severity: warn given: "$.paths[*][*].operationId" then: function: pattern functionOptions: match: "^[a-z][a-zA-Z0-9]*$" spg-date-params-format: description: Date parameters must use YYYY-MM-DD format message: "Date query parameters must be formatted as YYYY-MM-DD" severity: warn given: "$.paths[*][*].parameters[?(@.name =~ /[Dd]ate/)]" then: field: schema.format function: enumeration functionOptions: values: - date - date-time spg-pagination-params: description: List operations should include pageSize and page parameters message: "Collection GET endpoints should include pageSize and page parameters" severity: warn given: "$.paths[*][get]" then: function: schema functionOptions: schema: type: object spg-parameters-have-descriptions: description: All parameters must have descriptions message: "Parameter must include a description" severity: warn given: "$.paths[*][*].parameters[*]" then: field: description function: truthy spg-schema-names-pascal-case: description: Component schema names must use PascalCase message: "Schema name must use PascalCase" severity: warn given: "$.components.schemas[*]~" then: function: pattern functionOptions: match: "^[A-Z][a-zA-Z0-9&]*$"