Codehooks · API Governance Rules
Codehooks API Rules
Spectral linting rules defining API design standards and conventions for Codehooks.
10 Rules
error 4
warn 3
info 3
Rule Categories
codehooks
Rules
error
codehooks-info-contact
API contact information must be present.
$.info
error
codehooks-server-https
All server URLs must use HTTPS.
$.servers[*].url
warn
codehooks-server-template
Codehooks server URL must use the {projectId}.api.codehooks.io/{space} template.
$.servers[?(@.url && @.url.indexOf('codehooks.io') > -1)].url
error
codehooks-apikey-security
An API key security scheme must be defined.
$.components.securitySchemes[*]
error
codehooks-operation-id
Every operation must declare a unique operationId.
$.paths[*][get,post,put,patch,delete]
warn
codehooks-operation-tags
Operations must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
info
codehooks-collection-path
Collection-level paths should be declared as /{collection} or sub-paths thereof.
$.paths
warn
codehooks-error-responses
Mutating operations should declare 4xx error responses.
$.paths[*][post,put,patch,delete].responses
info
codehooks-query-parameter
List endpoints should accept the q query parameter for MongoDB-style filters.
$.paths['/{collection}'].get.parameters[*]
info
codehooks-pagination-hints
List endpoints should accept the h hints query parameter (sort, fields, offset, limit).
$.paths['/{collection}'].get.parameters[*].name