Mews · API Governance Rules
Mews API Rules
Spectral linting rules defining API design standards and conventions for Mews.
34 Rules
error 5
warn 12
info 17
Rule Categories
deprecation
info
no
openapi
operation
paths
request
response
schema
security
servers
tag
Rules
warn
info-title-mews-prefix
API title should identify Mews.
$.info
warn
info-description-required
A meaningful info.description is required.
$.info
info
info-description-min-length
info.description should be reasonably descriptive.
$.info.description
error
info-version-required
info.version is required.
$.info
info
info-contact-required
A contact block should be present.
$.info
error
openapi-version-3
Specs must be OpenAPI 3.0.x.
$
error
servers-defined
At least one server must be defined.
$
error
servers-https
Server URLs must use HTTPS.
$.servers[*]
info
servers-mews-host
Production server should be the Mews API host.
$.servers[*]
warn
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths[*]~
info
paths-versioned
Mews paths carry an API version segment (/v1/).
$.paths[*]~
info
paths-camelcase-actions
Mews uses camelCase resource and RPC-style action segments (e.g. /accountNotes/getAll).
$.paths[*]~
warn
operation-post-only
Mews APIs are RPC-style and POST-only. Non-POST methods are unexpected.
$.paths[*]
error
operation-operationid-required
Every operation must have an operationId.
$.paths[*][post,get,put,delete,patch]
info
operation-operationid-pattern
operationId follows the Mews resource_action convention (e.g. accountNotes_getAll).
$.paths[*][post,get,put,delete,patch]
warn
operation-summary-required
Every operation must have a summary.
$.paths[*][post,get,put,delete,patch]
info
operation-summary-mews-prefix
Operation summaries are prefixed with 'Mews' and Title Cased.
$.paths[*][post,get,put,delete,patch]
warn
operation-description-required
Every operation must have a description.
$.paths[*][post,get,put,delete,patch]
warn
operation-tags-required
Every operation must have at least one tag.
$.paths[*][post,get,put,delete,patch]
info
operation-microcks-extension
Operations should carry x-microcks-operation for mock-server compatibility.
$.paths[*][post,get,put,delete,patch]
info
tag-title-case
Tags use Title Case (e.g. "Account Notes", "Reservation Groups").
$.tags[*]
warn
request-body-on-post
POST operations should declare a request body (Mews passes all input in the body).
$.paths[*].post
warn
request-body-json
Request bodies must offer application/json.
$.paths[*][post,put,patch].requestBody.content
warn
response-200-defined
Operations must define a 200 response.
$.paths[*][post,get,put,delete,patch].responses
info
response-401-defined
Operations should define a 401 (authentication) response.
$.paths[*][post,get,put,delete,patch].responses
info
response-429-defined
Operations should define a 429 response (Mews enforces 200 requests / 30s per AccessToken).
$.paths[*][post,get,put,delete,patch].responses
info
response-json-content
Success responses should return application/json.
$.paths[*][post,get,put,delete,patch].responses.200.content
info
schema-property-pascalcase
Mews schema properties are PascalCase (e.g. AccountId, ServiceOrders).
$.components.schemas[*].properties[*]~
info
schema-type-defined
Top-level component schemas should declare a type or composition keyword.
$.components.schemas[*]
warn
security-schemes-defined
components.securitySchemes must define the Mews token credentials.
$.components
info
security-global-defined
A global security requirement should be declared.
$
info
security-mews-tokens
Mews auth uses ClientToken and AccessToken (supplied in the request body).
$.components.securitySchemes
warn
no-empty-descriptions
Descriptions must not be empty when present.
$..description
info
deprecation-documented
Deprecated operations should be flagged with deprecated:true.
$.paths[*][post,get,put,delete,patch]