grubhub · API Governance Rules
grubhub API Rules
Spectral linting rules defining API design standards and conventions for grubhub.
44 Rules
error 8
warn 22
info 14
Rule Categories
delete
external
get
info
openapi
operation
parameter
paths
request
response
schema
security
servers
tag
tags
Rules
warn
info-title-grubhub-prefix
API title should start with "Grubhub".
$.info.title
warn
info-description-required
Info object must have a non-trivial description.
$.info
info
info-description-min-length
Info description should be reasonably descriptive.
$.info.description
error
info-version-required
API version must be defined.
$.info
info
info-contact-required
A contact object should be present.
$.info
info
info-terms-of-service
Terms of service should be linked.
$.info
warn
openapi-version-3-1
Grubhub specs use OpenAPI 3.1.0.
$.openapi
error
servers-defined
At least one server must be defined.
$.servers
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
info
servers-description
Each server should have a description.
$.servers[*]
warn
paths-pos-v1-prefix
Grubhub partner paths are namespaced under /pos/v1/.
$.paths[*]~
warn
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths[*]~
warn
paths-snake-case-params
Path templating uses snake_case parameter names.
$.paths[*]~
error
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-grubhub-prefix
Operation summaries should start with "Grubhub".
$.paths[*][get,post,put,patch,delete].summary
warn
operation-description-required
Every operation must 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 must be camelCase.
$.paths[*][get,post,put,patch,delete].operationId
info
operation-operationid-verb-prefix
operationId should start with a recognized verb prefix.
$.paths[*][get,post,put,patch,delete].operationId
warn
operation-tags-required
Every operation must be tagged.
$.paths[*][get,post,put,patch,delete]
info
operation-microcks-extension
Operations should carry an x-microcks-operation extension for mock compatibility.
$.paths[*][get,post,put,patch,delete]
info
tags-global-defined
Global tags array should be defined.
$
info
tag-description-required
Each global tag should have a description.
$.tags[*]
warn
tag-title-case
Tag names use Title Case (each word capitalized).
$.tags[*].name
warn
parameter-description-required
Parameters must have a description.
$.paths[*][*].parameters[*]
warn
parameter-snake-case
Parameter names use snake_case.
$.paths[*][*].parameters[?(@.name)].name
warn
parameter-schema-typed
Parameters must declare a schema type.
$.paths[*][*].parameters[*].schema
warn
parameter-component-description
Shared parameter components must have a description.
$.components.parameters[*]
warn
request-body-json
Request bodies should offer application/json content.
$.paths[*][post,put,patch].requestBody.content
error
response-success-defined
Each operation must define a 2xx success response.
$.paths[*][get,post,put,patch,delete].responses
info
response-auth-failure-defined
Operations should document a 401 authentication-failure response.
$.paths[*][get,post,put,patch,delete].responses
warn
response-description-required
Each response must have a description.
$.paths[*][*].responses[*]
warn
schema-property-snake-case
Schema properties use snake_case.
$.components.schemas[*].properties[*]~
warn
schema-description-required
Top-level component schemas must have a description.
$.components.schemas[*]
warn
schema-property-typed
Schema properties must declare a type or $ref.
$.components.schemas[*].properties[*]
info
schema-error-envelope
The Error schema should expose error, message, and status fields.
$.components.schemas.Error.properties
warn
security-global-defined
A global security requirement should be declared.
$
error
security-schemes-defined
Security schemes must be defined under components.
$.components
info
security-scheme-description
Each security scheme should be described.
$.components.securitySchemes[*]
info
security-hmac-authorization-header
HMAC scheme should be carried in the Authorization header.
$.components.securitySchemes.hmacAuth
error
get-no-request-body
GET operations must not declare a request body.
$.paths[*].get
warn
delete-no-request-body
DELETE operations should not declare a request body.
$.paths[*].delete
info
external-docs-encouraged
Specs are encouraged to link external documentation.
$
info
operation-examples-encouraged
JSON responses are encouraged to provide examples for mocking.
$.paths[*][*].responses[*].content.application/json