Novu · API Governance Rules
Novu API Rules
Spectral linting rules defining API design standards and conventions for Novu.
38 Rules
error 9
warn 20
info 9
Rule Categories
components
delete
get
info
no
openapi
operation
parameter
paths
request
response
schema
security
servers
tags
Rules
warn
info-title-novu-prefix
API title should identify the API as a Novu surface.
$.info.title
warn
info-description-required
info.description must be present and non-empty.
$.info
info
info-contact-required
info.contact should be defined.
$.info
info
info-license-required
info.license should be defined (Novu is MIT licensed).
$.info
warn
info-version-semver
info.version should follow semantic versioning.
$.info.version
error
openapi-version-3
Use OpenAPI 3.x.
$.openapi
error
servers-https-only
All servers MUST use HTTPS.
$.servers[*].url
info
servers-novu-domain
Server URLs should target a novu.co domain.
$.servers[*].url
warn
paths-kebab-case
Path segments (excluding parameters) should use kebab-case.
$.paths.*~
warn
paths-version-prefix
Every path should be versioned (e.g. /v1/, /v2/).
$.paths.*~
error
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths.*~
error
paths-no-query-string
Path keys must not include query strings.
$.paths.*~
error
operation-operationid-required
Every operation must declare an operationId.
$.paths.*[get,post,put,patch,delete]
warn
operation-operationid-camelcase
operationId should be camelCase (Novu uses ControllerName_methodName pattern).
$.paths.*[get,post,put,patch,delete].operationId
error
operation-summary-required
Every operation must declare a summary.
$.paths.*[get,post,put,patch,delete]
warn
operation-summary-novu-prefix
Operation summary should start with the 'Novu' provider prefix and be in Title Case.
$.paths.*[get,post,put,patch,delete].summary
warn
operation-description-required
Every operation should declare a description.
$.paths.*[get,post,put,patch,delete]
warn
operation-tags-required
Every operation should declare at least one tag.
$.paths.*[get,post,put,patch,delete]
warn
tags-title-case
Tag names should be in Title Case (matches the resource grouping in the Novu Dashboard).
$.tags[*].name
warn
parameter-description-required
Every parameter should declare a description.
$.paths.*[get,post,put,patch,delete].parameters[*]
warn
parameter-camelcase
Parameter names should be camelCase (Novu convention, e.g. subscriberId, environmentId).
$.paths.*[get,post,put,patch,delete].parameters[?(@.in!='header')].name
info
parameter-pagination-cursor-limit
Paginated list endpoints should expose cursor + limit parameters.
$.paths.*.get.parameters[?(@.name=='limit')]
warn
request-body-application-json
Request bodies should accept application/json.
$.paths.*[post,put,patch].requestBody.content
error
response-2xx-required
Every operation must define at least one 2xx response.
$.paths.*[get,post,put,patch,delete].responses
warn
response-401-required
Authenticated operations should document the 401 Unauthorized response.
$.paths.*[get,post,put,patch,delete].responses
info
response-429-required
Rate-limited operations should document the 429 Too Many Requests response.
$.paths.*[get,post,put,patch,delete].responses
warn
response-error-content-type
Error responses should return application/json.
$.paths.*[get,post,put,patch,delete].responses[?(@property.match(/^[45]/))].content
info
response-rate-limit-headers
Successful responses should expose RateLimit-Limit / RateLimit-Remaining / RateLimit-Reset / RateLimit-Policy headers per Novu's policy.
$.paths.*[get,post,put,patch,delete].responses[?(@property.match(/^2/))].headers
info
response-idempotency-headers
Mutating operations should expose Idempotency-Key / Idempotency-Replay response headers.
$.paths.*[post,put,patch,delete].responses[?(@property.match(/^2/))].headers
warn
schema-property-camelcase
Schema property names should be camelCase (Novu DTO convention).
$.components.schemas[*].properties.*~
warn
schema-type-required
Top-level schemas must declare a type.
$.components.schemas[*]
info
schema-dto-suffix
Request/response DTO schemas should use the Dto suffix Novu adopts (RequestDto / ResponseDto / Dto).
$.components.schemas
error
security-scheme-secretkey-required
components.securitySchemes must define the secretKey ApiKey scheme used by Novu.
$.components.securitySchemes
warn
security-apikey-header
The secretKey scheme should be an ApiKey scheme delivered in the Authorization header.
$.components.securitySchemes.secretKey
error
get-no-request-body
GET operations should not declare a request body.
$.paths.*.get.requestBody
info
delete-204-or-200
DELETE operations should respond with 200 or 204.
$.paths.*.delete.responses
warn
components-schemas-defined
components.schemas should be defined.
$.components
warn
no-empty-description
Descriptions, when present, must be non-empty.
$..description