BlueCart · API Governance Rules
BlueCart API Rules
Spectral linting rules defining API design standards and conventions for BlueCart.
38 Rules
error 8
warn 17
info 13
Rule Categories
delete
error
get
info
openapi
operation
parameter
path
request
response
schema
security
server
servers
tag
tags
Rules
error
info-title-required
API must have a title.
$.info
warn
info-title-bluecart-prefix
API title should reference BlueCart.
$.info.title
warn
info-description-required
API must have a meaningful description.
$.info
error
info-version-required
API must declare a version.
$.info
info
info-contact-required
API should provide contact information.
$.info
warn
openapi-version-3
Specs should be OpenAPI 3.0.x.
$.openapi
error
servers-defined
At least one server must be defined.
$.servers
error
server-https
Servers must use HTTPS.
$.servers[*].url
info
server-description
Servers should be described.
$.servers[*]
error
path-no-query-string
Path keys must not contain a query string.
$.paths[*]~
error
operation-operationId-required
Every operation must have an operationId.
$.paths[*][get,post,put,delete,patch]
warn
operation-operationId-camelcase
operationId should be camelCase.
$.paths[*][get,post,put,delete,patch].operationId
info
operation-operationId-verb-prefix
operationId should begin with a recognised verb.
$.paths[*][get,post,put,delete,patch].operationId
warn
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,delete,patch]
info
operation-summary-title-case
Operation summaries should use Title Case (each word capitalised).
$.paths[*][get,post,put,delete,patch].summary
warn
operation-description-required
Every operation must have a description.
$.paths[*][get,post,put,delete,patch]
warn
operation-tags-required
Every operation must have at least one tag.
$.paths[*][get,post,put,delete,patch]
info
operation-microcks-extension
Operations should carry x-microcks-operation for mock compatibility.
$.paths[*][get,post,put,delete,patch]
info
tags-defined
Global tags array should be defined.
$
info
tag-description
Each global tag should have a description.
$.tags[*]
warn
tag-title-case
Tag names should use Title Case.
$.tags[*].name
warn
parameter-description
Parameters should have a description.
$.paths[*][*].parameters[*]
warn
parameter-schema
Parameters should declare a schema with a type.
$.paths[*][*].parameters[*].schema
warn
parameter-camelcase
Query and path parameters should be camelCase (BlueCart convention).
$.paths[*][*].parameters[?(@.in=='query' || @.in=='path')].name
info
parameter-pagination-nexttoken
Cursor pagination parameters should be named nextToken (BlueCart convention).
$.paths[*][*].parameters[?(@.in=='query')].name
warn
request-body-json
Request bodies should use application/json.
$.paths[*][post,put,patch].requestBody.content
warn
response-success-defined
Operations should declare a 2xx success response.
$.paths[*][get,post,put,delete,patch].responses
info
response-unauthorized
Operations should document a 401 response.
$.paths[*][get,post,put,delete,patch].responses
warn
response-description
Every response must have a description.
$.paths[*][*].responses[*]
info
error-schema-message
The Error schema should expose a message field.
$.components.schemas.Error.properties
warn
schema-property-camelcase
Schema property names should be camelCase (BlueCart convention).
$.components.schemas[*].properties[*]~
info
schema-top-level-description
Top-level component schemas should have a description.
$.components.schemas[*]
info
schema-property-type
Schema properties should declare a type (or $ref).
$.components.schemas[*].properties[*]
warn
security-global-defined
A global security requirement should be defined.
$
error
security-schemes-defined
Security schemes must be defined in components.
$.components.securitySchemes
info
security-apikey-header
The API key should be carried in the x-api-key header (BlueCart convention).
$.components.securitySchemes.apiKey
error
get-no-request-body
GET operations must not declare a request body.
$.paths[*].get
warn
delete-no-request-body
DELETE operations should not declare a request body.
$.paths[*].delete