Olo · API Governance Rules
Olo API Rules
Spectral linting rules defining API design standards and conventions for Olo.
36 Rules
error 8
warn 18
info 10
Rule Categories
error
external
get
info
no
openapi
operation
parameter
path
paths
request
response
schema
security
servers
tag
tags
Rules
error
info-title-required
API must have a title.
$.info
warn
info-title-olo-prefix
API title should begin with "Olo".
$.info.title
warn
info-description-required
API must have a meaningful description (min 40 chars).
$.info
error
info-version-required
API must declare a version.
$.info
info
info-contact-required
API should declare a contact.
$.info
warn
openapi-version-3-1
Specs should use OpenAPI 3.1.x.
$.openapi
error
servers-defined
At least one server must be defined.
$.servers
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
warn
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths.*~
warn
paths-lowercase
Path segments should be lowercase (Olo uses lowercase resource paths).
$.paths.*~
error
paths-no-query-string
Paths must not contain query strings.
$.paths.*~
warn
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-title-case
Operation summaries should be Title Case.
$.paths[*][get,post,put,patch,delete].summary
info
operation-description-required
Every operation should have a description.
$.paths[*][get,post,put,patch,delete]
error
operation-operationid-required
Every operation must have an operationId.
$.paths[*][get,post,put,patch,delete]
warn
operation-operationid-camelcase
operationId should be camelCase (Olo convention, e.g. createAccount).
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-tags-required
Every operation must have at least one tag.
$.paths[*][get,post,put,patch,delete]
info
tags-defined-globally
A global tags array should be defined.
$
warn
tag-title-case
Tag names should be Title Case (e.g. "Accounts", "Promotions").
$.tags[*].name
warn
parameter-description-required
Parameters should have descriptions.
$.paths[*][*].parameters[*]
info
parameter-camelcase
Parameter names should be camelCase (Olo convention, e.g. membershipNumber).
$.paths[*][*].parameters[*].name
warn
request-body-json
Request bodies should offer application/json content.
$.paths[*][post,put,patch,delete].requestBody.content
error
response-success-defined
Operations must define a successful (200/201/204) response.
$.paths[*][get,post,put,patch,delete].responses
info
response-unauthorized-defined
Signature-authorized operations should document a 401 response.
$.paths[*][get,post,put,patch,delete].responses
warn
response-description-required
Every response must have a description.
$.paths[*][*].responses[*]
info
schema-property-camelcase
Schema property names should be camelCase (Olo convention).
$.components.schemas[*].properties.*~
info
schema-description-required
Top-level component schemas should have descriptions.
$.components.schemas[*]
warn
security-scheme-defined
Security schemes must be defined.
$.components.securitySchemes
info
security-scheme-described
Security schemes should describe the auth mechanism (Olo uses HMAC signatures).
$.components.securitySchemes[*]
error
get-no-request-body
GET operations must not declare a request body.
$.paths[*].get
info
external-docs-encouraged
APIs should link to external documentation (the Olo Developer Portal).
$
warn
path-params-casing
Path parameters should be camelCase (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
warn
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
info
schema-properties-casing
Schema properties should be snake_case (the dominant convention in this API).
$.components.schemas[*].properties
warn
error-schema-defined
A shared error schema (ErrorResponse) should be defined for error payloads.
$.components.schemas
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description