Yelp · API Governance Rules
Yelp API Rules
Spectral linting rules defining API design standards and conventions for Yelp.
32 Rules
error 6
warn 17
info 9
Rule Categories
get
global
info
openapi
operation
parameter
paths
request
response
schema
security
server
servers
tag
Rules
warn
info-title-yelp
API title should identify Yelp.
$.info
warn
info-description-required
API must have a description of reasonable length.
$.info
info
info-contact-required
API should declare a contact.
$.info
error
info-version-required
API must declare a version.
$.info
warn
openapi-3-1
Specs should target OpenAPI 3.1.x.
$
error
servers-defined
At least one server must be defined.
$
error
servers-https
Server URLs must use HTTPS.
$.servers[*]
info
server-is-yelp-host
Production server should be api.yelp.com.
$.servers[*]
warn
paths-versioned
Paths should be versioned under /v3 or /ai.
$.paths[*]~
error
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths[*]~
warn
paths-snake-or-kebab-segments
Static path segments use lowercase letters, digits, underscores or hyphens.
$.paths[*]~
error
operation-operationId-required
Every operation must have an operationId.
$.paths[*][get,post,put,patch,delete]
warn
operation-operationId-camelcase-verb
operationId should be camelCase starting with a verb (get, list, search, create, update, delete, match, autocomplete, ai).
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
info
operation-summary-title-case
Operation summaries should be Title Case.
$.paths[*][get,post,put,patch,delete]
info
operation-description-required
Every operation should have a description.
$.paths[*][get,post,put,patch,delete]
warn
operation-tags-required
Every operation must be tagged.
$.paths[*][get,post,put,patch,delete]
info
global-tags-defined
A global tags array should be present.
$
warn
tag-title-case
Tag names should be Title Case.
$.tags[*]
warn
parameter-description-required
Parameters should have a description.
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
parameter-snake-case
Parameter names should be snake_case (Yelp convention).
$.paths[*][get,post,put,patch,delete].parameters[*]
info
parameter-pagination-offset-limit
Pagination should use offset and limit (Yelp convention), not page/size.
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
request-body-json
Request bodies should offer application/json content.
$.paths[*][post,put,patch].requestBody.content
warn
response-200-present
Read operations should define a 200 response.
$.paths[*][get].responses
info
response-401-present
Operations should document a 401 unauthorized response.
$.paths[*][get,post,put,patch,delete].responses
info
response-429-present
Operations should document a 429 rate-limit 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[*]
warn
schema-property-snake-case
Schema properties should be snake_case (Yelp convention).
$.components.schemas[*].properties[*]~
info
schema-error-has-code
The Error schema should expose an error object with a code/description.
$.components.schemas.Error.properties
warn
global-security-defined
A global security requirement should be declared.
$
warn
security-scheme-bearer
A bearer security scheme should be defined (Yelp API key as bearer token).
$.components.securitySchemes[*]
error
get-no-request-body
GET operations must not declare a request body.
$.paths[*].get