ReqRes · API Governance Rules
ReqRes API Rules
Spectral linting rules defining API design standards and conventions for ReqRes.
43 Rules
error 15
warn 18
info 10
Rule Categories
delete
get
info
no
openapi
operation
parameter
paths
post
request
response
schema
security
servers
tag
Rules
warn
info-title-reqres-prefix
Spec title should begin with "ReqRes".
$.info
error
info-description-required
Spec must include a non-empty description.
$.info
error
info-version-required
Spec must declare a version.
$.info
warn
info-contact-required
Spec should declare a contact block.
$.info
warn
info-license-required
Spec must include license info (ReqRes is MIT).
$.info
warn
openapi-version-3-0-x
Specs must target OpenAPI 3.0.x.
$.openapi
error
servers-defined
At least one server URL must be defined.
$
error
servers-https-required
All production server URLs must use HTTPS.
$.servers[?(@.url =~ /^https?:\/\/(?!localhost)/)].url
warn
servers-reqres-host
Production server URL should point at reqres.in.
$.servers[?([email protected]("localhost"))].url
error
paths-lowercase
Paths must be lowercase kebab-case.
$.paths.*~
error
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths.*~
warn
paths-prefix-known
Top-level path segments must be one of /api, /app, /agent.
$.paths.*~
info
paths-plural-resources
Resource collections should use plural nouns (users, collections, app-users, orders).
$.paths.*~
error
operation-summary-required
Every operation must have a summary.
$.paths.*[get,post,put,patch,delete]
warn
operation-description-required
Every operation must have a description.
$.paths.*[get,post,put,patch,delete]
warn
operation-summary-reqres-prefix
Every operation summary must start with "ReqRes".
$.paths.*[get,post,put,patch,delete].summary
error
operation-operationid-required
Every operation must declare 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 begin with a known verb (list/get/create/update/delete/login/register/logout/verify/simulate).
$.paths.*[get,post,put,patch,delete].operationId
error
operation-tags-required
Every operation must declare at least one tag.
$.paths.*[get,post,put,patch,delete]
warn
operation-security-required
Every /api/* and /app/* operation must declare security; /agent/v1/* may be public.
$.paths[?(@property.match(/^\/(api|app)\//))][get,post,put,patch,delete]
info
operation-microcks-extension
Every operation should declare x-microcks-operation for mock-server compatibility.
$.paths.*[get,post,put,patch,delete]
warn
tag-title-case
Global tag names must use Title Case (Legacy, Authentication, Collections, App Users, Custom Endpoints, Agent Sandbox).
$.tags[*].name
info
tag-description-recommended
Each global tag should include a description.
$.tags[*]
warn
parameter-description-required
Every parameter must have a description.
$.paths.*[get,post,put,patch,delete].parameters[*]
warn
parameter-snake-or-camel
Parameter names must be snake_case or camelCase (page, per_page, recordId).
$.paths.*[get,post,put,patch,delete].parameters[*].name
info
parameter-pagination-page-per-page
Pagination parameters should be named page and per_page (ReqRes convention).
$.paths.*[get,post,put,patch,delete].parameters[?(@.in=="query" && (@.name=="limit" || @.name=="offset"))]
error
request-body-json-content
Request bodies must accept application/json.
$.paths.*[post,put,patch].requestBody.content
info
request-body-description-recommended
Request bodies should include a description.
$.paths.*[post,put,patch].requestBody
error
response-success-required
Every operation must define a 2xx success 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
response-json-content
Success responses must return application/json.
$.paths.*[get,post,put,patch,delete].responses[?(@property.match(/^2\d\d$/))].content
info
response-401-on-secured
Secured operations should declare a 401 response.
$.paths.*[get,post,put,patch,delete][?(@.security)]
info
schema-property-snake-or-camel
Schema property names should be snake_case or camelCase.
$.components.schemas.*.properties.*~
info
schema-description-recommended
Top-level schemas should include a description.
$.components.schemas.*
error
schema-type-required
Top-level schemas must declare a type.
$.components.schemas.*
error
security-schemes-defined
components.securitySchemes must define ApiKeyAuth and BearerAuth.
$.components.securitySchemes
warn
security-apikey-header
ApiKeyAuth must use the x-api-key header.
$.components.securitySchemes.ApiKeyAuth
warn
security-bearer-format
BearerAuth must be an HTTP bearer scheme.
$.components.securitySchemes.BearerAuth
error
get-no-request-body
GET operations must not declare a request body.
$.paths.*.get
error
delete-no-request-body
DELETE operations must not declare a request body.
$.paths.*.delete
info
post-put-patch-require-body
POST, PUT, and PATCH operations should declare a request body (login/register/logout exempt).
$.paths.*[put,patch]
warn
no-empty-descriptions
Descriptions must be non-empty when present.
$..description