Otter · API Governance Rules
Otter API Rules
Spectral linting rules defining API design standards and conventions for Otter.
29 Rules
error 6
warn 13
info 10
Rule Categories
get
global
info
microcks
no
openapi
operation
parameter
path
request
response
schema
security
server
servers
store
tag
Rules
error
info-title-required
API must declare an info.title.
$.info
warn
info-description-required
API must have a meaningful info.description.
$.info
warn
info-contact-required
API must declare a maintainer contact.
$.info
error
info-version-required
API must declare info.version.
$.info
warn
openapi-version-3
Specs should target OpenAPI 3.0.x as the Otter Public API does.
$.openapi
error
servers-defined
At least one server must be defined.
$.servers
warn
server-description-required
Each server should describe how its host is provisioned (Otter hosts are account-specific).
$.servers[*]
warn
path-no-trailing-slash
Paths must not end with a trailing slash.
$.paths[*]~
info
path-segments-lower
Static path segments use lower-case (camelCase placeholders like {orderId} are allowed).
$.paths[*]~
info
path-versioned
Otter Public API paths are versioned; expect a /v1 segment.
$.paths[*]~
error
operation-operationid-required
Every operation must declare an operationId.
$.paths[*][get,post,put,patch,delete]
warn
operation-operationid-camelcase
operationIds follow camelCase (createOrder, getManagerOrder).
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-summary-required
Every operation must declare a summary.
$.paths[*][get,post,put,patch,delete]
info
operation-summary-otter-prefix
Operation summaries are prefixed with the provider name "Otter".
$.paths[*][get,post,put,patch,delete].summary
warn
operation-tags-required
Every operation must be tagged.
$.paths[*][get,post,put,patch,delete]
warn
tag-title-case
Tags use Title Case with spaces (e.g. "Orders Endpoints", "Menus Webhooks").
$.paths[*][get,post,put,patch,delete].tags[*]
info
global-tags-described
Global tag definitions should carry a description.
$.tags[*]
info
parameter-description-required
Parameters should be described.
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
parameter-schema-required
Parameters must define a schema with a type.
$.paths[*][get,post,put,patch,delete].parameters[?(@.in != 'body')]
info
store-id-header-name
Store-scoped requests identify the store via the X-Store-Id header.
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='header' && @.name)]
info
request-body-json
Request bodies should offer application/json content.
$.paths[*][post,put,patch].requestBody.content
warn
response-success-defined
Operations must define at least one 2xx response.
$.paths[*][get,post,put,patch,delete].responses
warn
response-description-required
Every response must have a description.
$.paths[*][get,post,put,patch,delete].responses[*]
info
schema-type-defined
Component schemas should define a type or composition keyword.
$.components.schemas[*]
error
security-schemes-defined
Security schemes must be defined (Otter uses OAuth 2.0 bearer tokens).
$.components.securitySchemes
info
security-oauth2-present
The OAuth2.0 security scheme should be present.
$.components.securitySchemes
error
get-no-request-body
GET operations must not define a request body.
$.paths[*].get
warn
no-empty-description
Descriptions, where present, must not be empty.
$..description
info
microcks-operation-encouraged
Operations should carry x-microcks-operation for mock-server compatibility.
$.paths[*][get,post,put,patch,delete]