Umami · API Governance Rules
Umami API Rules
Spectral linting rules defining API design standards and conventions for Umami.
31 Rules
error 13
warn 11
info 7
Rule Categories
analytics
get
info
no
openapi
operation
parameter
paths
request
response
schema
security
servers
Rules
error
info-title-umami-prefix
API title must start with "Umami"
$.info.title
error
info-description-required
API info must have a description with at least 50 characters
$.info.description
error
info-version-required
API info must include a version
$.info.version
warn
info-contact-url
API contact should include URL pointing to umami.is
$.info.contact.url
error
openapi-version-3
OpenAPI version must be 3.0.x
$.openapi
error
servers-required
At least one server must be defined
$.servers
info
servers-umami-domain
Server URL should use umami.is domain or localhost for self-hosted
$.servers[*].url
info
paths-api-prefix
All paths should start with /api/
$.paths[*]~
warn
paths-no-trailing-slash
Paths must not have a trailing slash
$.paths[*]~
info
paths-kebab-case
Path segments should use kebab-case
$.paths[*]~
error
operation-operationId-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-umami-prefix
Operation summary must start with "Umami"
$.paths[*][get,post,put,patch,delete].summary
warn
operation-description-required
Every operation must have a description
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
Every operation must have at least one tag
$.paths[*][get,post,put,patch,delete]
warn
operation-operationId-camelCase
OperationId must use camelCase
$.paths[*][get,post,put,patch,delete].operationId
warn
parameter-description-required
Every parameter must have a description
$.paths[*][get,post,put,patch,delete].parameters[*]
info
parameter-camelCase
Query parameter names should use camelCase
$.paths[*][get,post,put,patch,delete].parameters[?(@.in == 'query')].name
info
parameter-timestamps-ms
Timestamp parameters should indicate millisecond precision in their names or descriptions
$.paths[*][get].parameters[?(@.name == 'startAt' || @.name == 'endAt')]
warn
request-body-json
Request body should include application/json content type
$.paths[*][post,put,patch].requestBody.content
error
response-success-required
Every operation must define at least one 2xx response
$.paths[*][get,post,put,patch,delete].responses
warn
response-401-required
Operations should define 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-description-required
Top-level schemas should have descriptions
$.components.schemas[*]
warn
schema-property-type
Schema properties should have types defined
$.components.schemas[*].properties[*]
info
schema-uuid-format
ID fields should use format uuid
$.components.schemas[*].properties[?(@.description =~ /identifier/i)].format
error
security-schemes-defined
Security schemes must be defined in components
$.components.securitySchemes
warn
security-global-required
Global security should be defined
$.security
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
info
analytics-timestamps-required
Analytics operations should accept startAt and endAt timestamp parameters
$.paths[*][get].parameters[*].name
error
no-empty-descriptions
Descriptions must not be empty strings
$..description