Swetrix · API Governance Rules
Swetrix API Rules
Spectral linting rules defining API design standards and conventions for Swetrix.
9 Rules
error 2
warn 6
Rule Categories
swetrix
Rules
warn
swetrix-api-key-header
Admin and Statistics API endpoints must use X-Api-Key security scheme
$.components.securitySchemes
warn
swetrix-operation-id-camel-case
Operation IDs must use camelCase naming convention
$.paths[*][get,post,put,patch,delete]
hint
swetrix-events-path-prefix
Events API paths should use /log prefix
$.paths
warn
swetrix-summary-title-case
Operation summaries must use Title Case
$.paths[*][get,post,put,patch,delete].summary
error
swetrix-post-request-body
POST operations must define a requestBody
$.paths[*].post
warn
swetrix-operation-tags
All operations must have at least one tag
$.paths[*][get,post,put,patch,delete]
error
swetrix-pid-required
The pid parameter must be marked as required
$.paths[*][get,post,put,patch,delete].parameters[?(@.name == 'pid')]
warn
swetrix-error-responses
Mutating operations should document 400 error responses
$.paths[*][post,put,patch].responses
warn
swetrix-success-response-content
Success responses (200/201) should define content schema
$.paths[*][get,post,put,patch].responses[200,201]