Toast · API Governance Rules
Toast API Rules
Spectral linting rules defining API design standards and conventions for Toast.
39 Rules
error 9
warn 12
info 18
Rule Categories
delete
error
examples
get
info
no
operation
parameter
path
paths
query
response
schema
security
servers
toast
Rules
error
info-title-required
Info object must have a title
$.info
warn
info-title-toast-prefix
API title should start with 'Toast'
$.info.title
warn
info-description-required
Info object must have a description
$.info
error
info-version-required
Info object must have a version
$.info
error
servers-defined
Servers array must be defined
$
error
servers-https
Server URLs must use HTTPS
$.servers[*].url
warn
paths-no-trailing-slash
Paths must not end with a trailing slash
$.paths[*]~
info
paths-guid-parameters
Path parameters for identifiers should use 'guid' naming
$.paths[*]~
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete]
info
operation-summary-toast-prefix
Operation summaries should start with 'Toast'
$.paths[*][get,post,put,patch,delete].summary
error
operation-operationid-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
operation-operationid-camel-case
OperationId should use camelCase
$.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
operation-description-required
Operations should have a description
$.paths[*][get,post,put,patch,delete]
warn
parameter-description-required
All parameters must have a description
$.paths[*][get,post,put,patch,delete][parameters][*]
info
parameter-restaurant-guid-header
Restaurant GUID should be passed as a header named Toast-Restaurant-External-ID
$.paths[*][get,post,put,patch,delete][parameters][*][?(@.name=='restaurantGuid')]
error
response-success-required
Operations must define at least one 2xx response
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
All response objects must have a description
$.paths[*][get,post,put,patch,delete].responses[*]
info
response-401-defined
Secured operations should define a 401 Unauthorized response
$.paths[*][get,post,put,patch,delete].responses
info
response-404-on-get-by-id
GET by ID operations should define a 404 Not Found response
$.paths[*~*Guid*][get].responses
info
schema-property-camel-case
Schema property names should use camelCase
$.definitions[*].properties[*]~
info
schema-description-required
Top-level schemas should have a description
$.definitions[*]
info
schema-guid-property-format
Properties named 'guid' should have format uuid
$.definitions[*].properties[?(@property === 'guid')]
info
security-defined
Security should be defined at the API level
$
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
info
delete-returns-no-content
DELETE operations should return 204 No Content
$.paths[*].delete.responses
info
toast-restaurant-guid-required
Most Toast APIs require Toast-Restaurant-External-ID header
$.paths[*][get,post,put,patch].parameters
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description
info
examples-encouraged
Schema properties should have example values
$.definitions[*].properties[*]
info
schema-property-camel-case-oas3
Schema property names should use camelCase (OpenAPI 3)
$.components.schemas[*].properties[*]~
info
schema-description-required-oas3
Top-level schemas should have a description (OpenAPI 3)
$.components.schemas[*]
info
examples-encouraged-oas3
Schema properties should have example values (OpenAPI 3)
$.components.schemas[*].properties[*]
info
security-schemes-oas3
Security schemes should be defined (OpenAPI 3)
$.components
warn
path-params-casing
Path parameters should be camelCase (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
warn
query-params-casing
Query parameters should be camelCase (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
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
operation-security-required
Every operation should declare its security requirements.
$.paths[*][get,post,put,patch,delete]
warn
error-schema-defined
A shared error schema (ErrorMessage) should be defined for error payloads.
$.components.schemas