SnapAPI · API Governance Rules
SnapAPI API Rules
Spectral linting rules defining API design standards and conventions for SnapAPI.
12 Rules
error 4
warn 6
info 2
Rule Categories
snapapi
Rules
warn
snapapi-operation-id-required
All operations must have an operationId.
$.paths[*][get,post,put,patch,delete,head,options]
warn
snapapi-summary-title-case
Operation summaries must use Title Case.
$.paths[*][get,post,put,patch,delete].summary
warn
snapapi-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
info
snapapi-description-required
Every operation must have a description.
$.paths[*][get,post,put,patch,delete]
error
snapapi-apikey-auth-required
The API must define an ApiKeyAuth security scheme on the X-API-Key header.
$.components.securitySchemes.ApiKeyAuth
error
snapapi-servers-required
The API must define at least one server.
$
error
snapapi-response-200-or-201
Every operation must define a 200 or 201 success response.
$.paths[*][get,post,put,patch,delete].responses
warn
snapapi-401-response-required
Authenticated operations must define a 401 Unauthorized response.
$.paths[*][post,put,patch,delete,get].responses
warn
snapapi-429-on-metered-endpoints
Metered POST endpoints must declare a 429 Rate Limited response.
$.paths[/api/screenshot,/api/metadata,/api/text,/api/pdf].post.responses
info
snapapi-usage-headers-on-screenshot
The screenshot 200 response should signal X-Usage-Used and X-Usage-Limit headers.
$.paths[/api/screenshot].post.responses.200.headers
error
snapapi-url-required-in-body
Screenshot, metadata, text, and PDF operations must require a `url` field in the request body schema.
$.paths[/api/screenshot,/api/metadata,/api/text,/api/pdf].post.requestBody.content.application/json.schema
warn
snapapi-info-contact-required
The info object must include a contact entry.
$.info