Wiktionary · API Governance Rules
Wiktionary API Rules
Spectral linting rules defining API design standards and conventions for Wiktionary.
41 Rules
error 14
warn 16
info 11
Rule Categories
delete
get
info
no
openapi
operation
parameter
paths
request
response
schema
security
servers
tag
tags
user
Rules
error
info-title-wiktionary-prefix
Info title must begin with "Wiktionary".
$.info
error
info-description-required
Info description must be present and at least 60 characters.
$.info
error
info-license-cc-by-sa
License must be CC BY-SA 4.0 — Wiktionary content is CC BY-SA.
$.info.license
warn
info-contact-required
Info contact block must include name and url.
$.info.contact
error
openapi-version-3
All Wiktionary specs must use OpenAPI 3.0.x.
$.openapi
error
servers-defined
At least one server must be defined.
$
error
servers-https-only
All server URLs must use HTTPS.
$.servers[*]
warn
servers-wikimedia-host
Server URLs must point to en.wiktionary.org.
$.servers[*]
warn
paths-kebab-case
Path segments should use lowercase kebab-case (allowing wikitext fragments).
$.paths.*~
error
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths.*~
error
paths-no-query-strings
Paths must not contain query strings.
$.paths.*~
info
paths-v1-prefix-for-rest
REST endpoints (not /api.php) should be versioned with /v1/ or /page/ or /transform/.
$.paths.*~
error
operation-operationId-required
Every operation must have an operationId.
$.paths.*.[get,post,put,patch,delete]
warn
operation-operationId-camelcase
operationId must use camelCase.
$.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-wiktionary-prefix
Every operation summary must start with "Wiktionary".
$.paths.*.[get,post,put,patch,delete]
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]
info
operation-microcks-extension
Every operation should declare x-microcks-operation for mock-server compatibility.
$.paths.*.[get,post,put,patch,delete]
warn
tags-global-defined
Global tags array must be defined.
$
warn
tag-description-required
Every global tag must have a description.
$.tags[*]
info
tag-title-case
Global tag names should use Title Case (e.g. "Page Content", "Transform").
$.tags[*]
warn
parameter-description-required
Every parameter must have a description.
$.paths.*.[get,post,put,patch,delete].parameters[*]
warn
parameter-schema-required
Every parameter must have a schema with a type.
$.paths.*.[get,post,put,patch,delete].parameters[*]
info
parameter-name-snake-or-kebab
Parameter names should use snake_case or kebab-case (MediaWiki convention).
$.paths.*.[get,post,put,patch,delete].parameters[?(@.in=='query' || @.in=='path')]
warn
request-body-description
Request bodies should have a description.
$.paths.*.[post,put,patch].requestBody
info
request-body-json-content
Request bodies should support application/json.
$.paths.*.[post,put,patch].requestBody
error
response-2xx-required
Every operation must define at least one 2xx response.
$.paths.*.[get,post,put,patch,delete].responses
warn
response-200-description
2xx responses must have a description.
$.paths.*.[get,post,put,patch,delete].responses[?(@property.match(/^2/))]
info
response-404-on-page-endpoints
Page-content endpoints should document a 404 response.
$.paths[?(@property.match(/page|definition|file/))][get,post,put,patch,delete].responses
info
response-problem-details
Error responses (4xx, 5xx) should use application/problem+json (RFC 7807) on the REST APIs.
$.paths[?(@property.match(/page|transform|definition|file/))][get,post,put,patch,delete].responses[?(@property.match(/^[45]/))].content
warn
schema-title-required
Top-level schemas should have a title.
$.components.schemas.*
info
schema-description-required
Top-level schemas should have a description.
$.components.schemas.*
warn
schema-type-required
Top-level schemas must declare a type.
$.components.schemas.*
info
schema-property-snake-case
Schema property names should use snake_case to match MediaWiki JSON conventions.
$.components.schemas.*.properties.*~
warn
security-global-defined
Global security array must be present (empty {} is allowed for public read).
$
info
security-schemes-oauth2-bot
securitySchemes should include OAuth2 (and optionally botPassword) where authenticated access is supported.
$.components
error
get-no-request-body
GET operations must not have a request body.
$.paths.*.get
error
delete-no-request-body
DELETE operations must not have a request body.
$.paths.*.delete
warn
no-empty-descriptions
Descriptions must not be empty when present.
$..description
info
user-agent-rate-limit-note
The Wikimedia REST API requires a unique User-Agent or Api-User-Agent header. info.description should mention this requirement (rate-limit hint).
$.info