Toro · API Governance Rules
Toro API Rules
Spectral linting rules defining API design standards and conventions for Toro.
19 Rules
error 4
warn 14
info 1
Rule Categories
error
no
path
query
schema
security
servers
toro
Rules
warn
toro-operation-id-camel-case
Operation IDs must use camelCase
$.paths[*][*].operationId
warn
toro-operation-summary-title-case
Operation summaries must use Title Case
$.paths[*][*].summary
warn
toro-paths-kebab-case
API paths must use kebab-case for path segments
$.paths[*]~
error
toro-must-have-tags
All operations must have at least one tag
$.paths[*][get,post,put,patch,delete]
error
toro-responses-must-have-description
All responses must have a description
$.paths[*][*].responses[*]
error
toro-must-have-200-or-201
All operations must define a success response (200 or 201)
$.paths[*][get,post,put,patch,delete].responses
warn
toro-parameters-must-have-description
All parameters must have descriptions
$.paths[*][*].parameters[*]
warn
toro-request-body-content-type
Request bodies should use application/json content type
$.paths[*][post,put,patch].requestBody.content
warn
toro-error-response-schema
Error responses (4xx, 5xx) should reference a schema
$.paths[*][*].responses[4xx,5xx]
warn
toro-list-operations-must-support-pagination
List operations should support pagination parameters
$.paths[*][get][?(@.operationId =~ /^list/)]
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
warn
servers-expected-domain
Server URLs should be on the toro.com domain.
$.servers[*].url
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 snake_case (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
security-schemes-defined
Security schemes should be defined in components.
$.components
warn
error-schema-defined
A shared error schema (Error) should be defined for error payloads.
$.components.schemas
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description