WakaTime · API Governance Rules
WakaTime API Rules
Spectral linting rules defining API design standards and conventions for WakaTime.
51 Rules
error 18
warn 26
info 7
Rule Categories
http
info
no
openapi
operation
parameter
path
request
response
schema
security
servers
tag
Rules
warn
info-title-prefix
Spec title should start with "WakaTime".
$.info.title
error
info-description-required
info.description is required and should be meaningful.
$.info
warn
info-description-min-length
info.description should be at least 120 characters.
$.info.description
warn
info-contact-required
info.contact must be defined.
$.info
warn
info-contact-url-required
info.contact.url is required.
$.info.contact
warn
info-license-required
info.license is required.
$.info
error
info-version-required
info.version is required.
$.info
error
openapi-version-3
WakaTime specs should target OpenAPI 3.0.x.
$.openapi
error
servers-required
At least one server must be defined.
$.servers
error
servers-https-only
All servers must use HTTPS.
$.servers[*].url
warn
servers-wakatime-host
Servers should be hosted at wakatime.com (or api.wakatime.com).
$.servers[*].url
warn
path-segments-snake-case
Path segments use snake_case (lowercase letters, digits, underscores, dots, optional .bulk suffix).
$.paths[*]~
error
path-no-trailing-slash
Paths must not end with a trailing slash.
$.paths[*]~
error
path-no-query-string
Paths must not embed a query string.
$.paths[*]~
info
path-current-user-shortcut
User-scoped paths should use `current` for the authenticated user.
$.paths[*]~
error
operation-operationid-required
Every operation must have an operationId.
$.paths[*][get,post,put,delete,patch]
error
operation-operationid-camel-case
operationId must be camelCase.
$.paths[*][get,post,put,delete,patch].operationId
warn
operation-operationid-verb-prefix
operationId should start with a recognised verb (get/list/create/update/delete/put/abort/synchronize).
$.paths[*][get,post,put,delete,patch].operationId
error
operation-summary-required
Each operation must have a summary.
$.paths[*][get,post,put,delete,patch]
warn
operation-summary-title-case
Operation summaries should be Title Case (every significant word capitalised).
$.paths[*][get,post,put,delete,patch].summary
warn
operation-description-required
Each operation must have a description.
$.paths[*][get,post,put,delete,patch]
error
operation-tags-required
Every operation must declare at least one tag.
$.paths[*][get,post,put,delete,patch]
info
operation-microcks-extension
Operations should declare x-microcks-operation for mock-server compatibility.
$.paths[*][get,post,put,delete,patch]
warn
tag-global-array
Spec must declare a global tags array.
$
warn
tag-name-title-case
Tag names must be Title Case (e.g. "Custom Rules", "Org Dashboards").
$.tags[*].name
warn
tag-description-required
Every tag should have a description.
$.tags[*]
warn
parameter-description-required
Every parameter must have a description.
$.paths[*][*].parameters[*]
warn
parameter-name-snake-case
Query and path parameters must be snake_case.
$.paths[*][*].parameters[?(@.in=='query' || @.in=='path')].name
error
parameter-schema-required
Every parameter must declare a schema.
$.paths[*][*].parameters[*]
warn
parameter-date-format
Query parameter named `date` must use the date format (YYYY-MM-DD).
$.paths[*][*].parameters[?(@.name=='date')].schema
warn
parameter-range-enum
Path/query parameter named `range` should be enumerated with the WakaTime presets.
$.paths[*][*].parameters[?(@.name=='range')].schema
warn
parameter-api-key-not-in-query
Do not pass api_key as a query parameter in OpenAPI spec definitions — use the apiKey security scheme (HTTP Basic) or Bearer instead.
$.paths[*][*].parameters[?(@.name=='api_key')]
error
request-body-json-content
Request bodies must declare application/json content.
$.paths[*][post,put,patch].requestBody.content
error
request-body-schema-required
Request bodies must declare a schema.
$.paths[*][post,put,patch].requestBody.content.application/json
error
response-success-required
Every operation must declare at least one 2xx response.
$.paths[*][get,post,put,delete,patch].responses
info
response-401-recommended
Operations should document a 401 Unauthorized response.
$.paths[*][get,post,put,delete,patch].responses
info
response-429-recommended
Operations should document a 429 Too Many Requests response (WakaTime enforces rate limiting).
$.paths[*][get,post,put,delete,patch].responses
error
response-description-required
Each response must have a description.
$.paths[*][*].responses[*]
info
response-data-envelope
2xx JSON responses should wrap payloads in a `data` envelope (WakaTime convention).
$.paths[*][get].responses[?(@property.match(/2\d\d/))].content.application/json.schema
warn
schema-property-snake-case
Schema properties must be snake_case.
$.components.schemas[*].properties[*]~
warn
schema-property-type-defined
Schema properties must declare a type (or $ref / allOf / oneOf / anyOf).
$.components.schemas[*].properties[*]
warn
schema-timestamps-iso
Properties ending with _at or _date should declare format date-time or date.
$.components.schemas[*].properties[?(@property.match(/_(at|date)$/))]
warn
schema-seconds-numeric
Properties ending with _seconds should be numeric.
$.components.schemas[*].properties[?(@property.match(/_seconds$/))]
warn
security-global
Spec must define a global security requirement.
$
error
security-schemes-defined
components.securitySchemes must be defined.
$.components
warn
security-oauth2-defined
WakaTime specs must declare the oauth2 security scheme.
$.components.securitySchemes
warn
security-api-key-defined
WakaTime specs should declare the apiKey (HTTP Basic) security scheme for API-key auth.
$.components.securitySchemes
error
http-get-no-request-body
GET operations must not declare a requestBody.
$.paths[*].get.requestBody
warn
http-delete-no-required-body
DELETE operations should not require a request body (bulk-delete endpoints excepted but discouraged elsewhere).
$.paths[?([email protected](/\.bulk$/))][delete].requestBody
info
schema-examples-encouraged
Schemas should provide examples on at least some properties.
$.components.schemas[*]
info
no-deprecated-without-replacement
Deprecated operations should describe a replacement in the description.
$.paths[*][?(@.deprecated)]