BetterCloud · API Governance Rules
BetterCloud API Rules
Spectral linting rules defining API design standards and conventions for BetterCloud.
28 Rules
error 13
warn 13
info 2
Rule Categories
http
info
no
openapi
operation
pagination
parameter
paths
response
schema
security
servers
Rules
warn
info-title-prefix
API title should start with "BetterCloud"
$.info.title
error
info-description-required
API info must have a description
$.info
error
info-version-required
API must specify a version
$.info
warn
openapi-version
Should use OpenAPI 3.0.x
$.openapi
error
servers-defined
At least one server must be defined
$
error
servers-https-only
Server URLs must use HTTPS
$.servers[*].url
warn
paths-kebab-case
Path segments should use kebab-case
$.paths
error
paths-no-trailing-slash
Paths must not have trailing slashes
$.paths
error
operation-summary-required
All operations must have a summary
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-prefix
Operation summaries should start with "BetterCloud"
$.paths[*][get,post,put,patch,delete].summary
warn
operation-description-required
Operations should have descriptions
$.paths[*][get,post,put,patch,delete]
error
operation-id-required
All operations must have operationId
$.paths[*][get,post,put,patch,delete]
warn
operation-id-camel-case
operationId should use camelCase
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-tags-required
Operations must have tags
$.paths[*][get,post,put,patch,delete]
warn
parameter-description-required
Parameters must have descriptions
$.paths[*][get,post,put,patch,delete].parameters[*]
error
parameter-schema-required
Parameters must have schemas
$.paths[*][get,post,put,patch,delete].parameters[*]
error
response-success-required
Operations must define a success response
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
Response descriptions are required
$.paths[*][get,post,put,patch,delete].responses[*]
error
schema-error-required-fields
Error schema must have code, id, href, and reason fields
$.components.schemas.ErrorResponse.required
warn
schema-description-required
Component schemas should have descriptions
$.components.schemas[*]
error
security-schemes-defined
Security schemes must be defined
$.components
warn
security-global-defined
Global security should be defined
$
info
security-api-key-header
BetterCloud uses API key in header (X-API-Key)
$.components.securitySchemes[*][?(@.type=='apiKey')]
error
http-get-no-body
GET operations should not have request bodies
$.paths[*].get
warn
http-delete-no-body
DELETE operations should not have request bodies
$.paths[*].delete
warn
http-post-has-body
POST operations creating resources should have request bodies
$.paths[*].post
info
pagination-page-parameter
List endpoints should support page parameter
$.paths[*].get.parameters[?(@.name=='page')].schema.type
warn
no-empty-descriptions
Descriptions should not be empty
$..description