Wikipedia / MediaWiki · API Governance Rules
Wikipedia / MediaWiki API Rules
Spectral linting rules defining API design standards and conventions for Wikipedia / MediaWiki.
25 Rules
error 8
warn 11
info 6
Rule Categories
info
no
openapi
operation
parameter
path
request
response
schema
security
server
servers
tags
user
Rules
warn
info-title-prefix
Spec title should begin with "Wikipedia", "MediaWiki", "Wikimedia", or "Wikidata".
$.info
error
info-description-required
info.description must be present and non-trivial.
$.info
warn
info-license-required
info.license must be defined (CC BY-SA, CC0, or commercial).
$.info
error
openapi-version-3
OpenAPI version must be 3.x.
$.openapi
error
servers-required
At least one server must be declared.
$
warn
server-https
Servers must use https://.
$.servers[*].url
warn
path-no-trailing-slash
Paths should not end with a trailing slash.
$.paths
warn
path-snake-or-kebab
Path segments should use snake_case or kebab-case (lowercase, digits, dashes, underscores, or templated params).
$.paths
error
operation-operationid-required
Every operation must have a camelCase operationId.
$.paths[*][get,post,put,patch,delete]
error
operation-summary-required
Every operation must have a summary in Title Case prefixed with the provider name.
$.paths[*][get,post,put,patch,delete]
warn
operation-description-required
Every operation must have a description.
$.paths[*][get,post,put,patch,delete]
warn
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]
info
tags-title-case
Tag names should be Title Case (multi-word) or PascalCase.
$.tags[*].name
warn
parameter-description-required
Every parameter should have a description.
$.paths[*][*].parameters[*]
error
parameter-schema-required
Every parameter must have a schema with a type.
$.paths[*][*].parameters[*]
info
parameter-snake-case
Query and path parameters should use snake_case.
$.paths[*][*].parameters[?(@.in=='query' || @.in=='path')]
error
request-body-content-required
Request bodies must declare a content media type.
$.paths[*][post,put,patch].requestBody
error
response-success-required
Every operation must declare at least one 2xx response.
$.paths[*][get,post,put,patch,delete].responses
warn
response-description-required
Every response must have a description.
$.paths[*][*].responses[*]
info
schema-property-snake-case
Schema properties should use snake_case (MediaWiki convention).
$.components.schemas[*].properties
warn
schema-type-required
Each top-level component schema should declare a type.
$.components.schemas[*]
info
security-schemes-defined
Components must define securitySchemes if security is referenced.
$
warn
no-empty-description
Descriptions must not be empty when present.
$..description
info
user-agent-required-note
API description should mention contactable User-Agent requirement (Wikimedia policy).
$.info