Staples · API Governance Rules
Staples API Rules
Spectral linting rules defining API design standards and conventions for Staples.
21 Rules
error 9
warn 10
info 2
Rule Categories
staples
Rules
warn
staples-operation-ids-camel-case
Operation IDs must use camelCase naming convention
$.paths[*][*].operationId
warn
staples-operation-summary-title-case
Operation summaries must use Title Case
$.paths[*][*].summary
error
staples-api-versioned-paths
All API paths must be versioned with /v1/ prefix
$.paths
error
staples-bearer-auth-required
All operations must use Bearer token authentication
$.paths[*][*]
error
staples-get-operations-200
GET operations must define a 200 response
$.paths[*].get
error
staples-post-create-201
POST create operations must return 201 Created
$.paths[*].post
error
staples-unauthorized-response
All operations must define a 401 Unauthorized response
$.paths[*][*]
warn
staples-not-found-response
Operations with path parameters should define 404
$.paths[*][*]
warn
staples-rate-limit-response
All operations must define a 429 Too Many Requests response
$.paths[*][*]
warn
staples-operation-tags-required
All operations must have at least one tag
$.paths[*][*].tags
warn
staples-tags-title-case
All tags must use Title Case
$.paths[*][*].tags[*]
warn
staples-path-kebab-case
Path segments must use kebab-case
$.paths
warn
staples-no-trailing-slash
Paths must not have a trailing slash
$.paths
error
staples-path-parameters-required
Path parameters must be marked as required
$.paths[*][*].parameters[?(@.in=='path')]
warn
staples-query-parameters-described
Query parameters must have descriptions
$.paths[*][*].parameters[?(@.in=='query')]
error
staples-post-request-body
POST operations must define a request body
$.paths[*].post
info
staples-schemas-have-descriptions
Schema components should have descriptions where possible
$.components.schemas[*]
warn
staples-info-contact
API must have contact information
$.info
info
staples-info-terms
API must reference terms of service
$.info
error
staples-info-description
API must have a description
$.info
error
staples-servers-defined
API must define at least one server
$