Circana · API Governance Rules
Circana API Rules
Spectral linting rules defining API design standards and conventions for Circana.
41 Rules
error 20
warn 15
info 6
Rule Categories
delete
examples
get
info
microcks
no
openapi
operation
pagination
parameter
paths
post
request
response
schema
security
servers
tag
Rules
error
info-title-required
Info title must be present and non-empty
$.info
warn
info-title-circana-prefix
Info title should start with "Circana"
$.info
error
info-description-required
Info description must be present and non-empty
$.info
warn
info-description-min-length
Info description should be at least 50 characters
$.info.description
error
info-version-required
API version must be specified
$.info
warn
info-contact-required
Contact information should be provided
$.info
error
openapi-version-3
OpenAPI version must be 3.x
$
error
servers-defined
Servers array must be defined
$
error
servers-https
Server URLs should use HTTPS
$.servers[*].url
warn
servers-description
Each server should have a description
$.servers[*]
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
Every operation must have a summary
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-circana-prefix
Operation summaries should start with "Circana"
$.paths[*][get,post,put,patch,delete].summary
error
operation-description-required
Every operation must have a description
$.paths[*][get,post,put,patch,delete]
error
operation-operationid-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
operation-operationid-camelcase
operationId should use camelCase
$.paths[*][get,post,put,patch,delete].operationId
error
operation-tags-required
Every operation must have at least one tag
$.paths[*][get,post,put,patch,delete]
info
tag-description
Tags should have descriptions
$.tags[*]
warn
tag-title-case
Tag names should use Title Case
$.tags[*].name
error
parameter-description-required
Every parameter must have a description
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
parameter-snake-case
Parameter names should use snake_case
$.paths[*][get,post,put,patch,delete].parameters[*].name
error
parameter-schema-required
Parameters must have a schema with type
$.paths[*][get,post,put,patch,delete].parameters[*]
info
parameter-example-recommended
Parameters should include an example value
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
request-body-json-content
Request bodies should use application/json content type
$.paths[*][post,put,patch].requestBody.content
error
response-success-required
Every operation must have a success response (2xx)
$.paths[*][get,post,put,patch,delete].responses
warn
response-401-required
Operations should include a 401 Unauthorized response
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
Every response must have a description
$.paths[*][get,post,put,patch,delete].responses[*]
warn
schema-property-snake-case
Schema property names should use snake_case
$.components.schemas[*].properties
warn
schema-description-required
Top-level schemas should have descriptions
$.components.schemas[*]
error
schema-type-required
Schema properties must define a type
$.components.schemas[*].properties[*]
error
security-global-defined
Global security must be defined
$
error
security-schemes-defined
Security schemes must be defined in components
$.components
warn
security-scheme-description
Security schemes should have descriptions
$.components.securitySchemes[*]
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
warn
delete-no-request-body
DELETE operations should not have a request body
$.paths[*].delete
info
post-request-body-required
POST operations should have a request body
$.paths[*].post
error
no-empty-descriptions
Descriptions must not be empty strings
$.paths[*][get,post,put,patch,delete].description
info
examples-recommended
Response schemas should include examples
$.paths[*][get,post,put,patch,delete].responses[*].content.application/json
info
pagination-offset-limit
Paginated endpoints should use offset/limit parameters
$.paths[*].get.parameters[?(@.name=='offset' || @.name=='limit')]
info
microcks-operation-extension
Operations should include x-microcks-operation for mock compatibility
$.paths[*][get,post,put,patch,delete]