Punchh · API Governance Rules
Punchh API Rules
Spectral linting rules defining API design standards and conventions for Punchh.
31 Rules
error 3
warn 17
info 11
Rule Categories
info
openapi
operation
parameter
path
request
response
schema
security
server
servers
tag
tags
Rules
warn
info-title-prefix
API title should be prefixed with "PAR Punchh".
$.info.title
warn
info-description-required
Info object must have a meaningful description.
$.info
error
info-version-required
Info object must declare a version.
$.info
info
info-contact-required
Info object should include contact details.
$.info
warn
openapi-version-3
Specs must target OpenAPI 3.0.x.
$.openapi
error
servers-defined
Servers must be defined.
$
warn
server-https
Server URLs must use HTTPS.
$.servers[*].url
info
server-description
Each server should have a description.
$.servers[*]
warn
path-no-trailing-slash
Paths must not end with a trailing slash.
$.paths[*]~
info
path-snake-case-segments
Static path segments use snake_case (matching Punchh path style).
$.paths[*]~
error
operation-operationId-required
Every operation must have an operationId.
$.paths[*][get,post,put,delete,patch]
warn
operation-operationId-camel-case
operationId should be camelCase.
$.paths[*][get,post,put,delete,patch].operationId
warn
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,delete,patch]
info
operation-summary-title-case
Operation summaries should be Title Case.
$.paths[*][get,post,put,delete,patch].summary
warn
operation-description-required
Every operation must have a description.
$.paths[*][get,post,put,delete,patch]
warn
operation-tags-required
Every operation must be tagged.
$.paths[*][get,post,put,delete,patch]
info
operation-microcks-extension
Each operation should carry an x-microcks-operation extension for mocking.
$.paths[*][get,post,put,delete,patch]
info
tags-global-defined
A global tags array should be defined.
$
info
tag-description
Each global tag should have a description.
$.tags[*]
info
tag-title-case
Tag names should be Title Case.
$.tags[*].name
warn
parameter-description-required
Every parameter must have a description.
$.paths[*][*].parameters[*]
warn
parameter-snake-case
Parameter names should be snake_case.
$.paths[*][*].parameters[*].name
warn
parameter-schema-type
Every parameter must declare a schema type.
$.paths[*][*].parameters[*].schema
info
request-body-json
Request bodies should offer application/json content.
$.paths[*][post,put,patch].requestBody.content
warn
response-success-defined
Each operation must define a 2xx success response.
$.paths[*][get,post,put,delete,patch].responses
info
response-unauthorized
Authenticated operations should document a 401 response.
$.paths[*][get,post,put,delete,patch].responses
warn
response-description-required
Every response must have a description.
$.paths[*][*].responses[*]
warn
schema-property-snake-case
Schema property names should be snake_case.
$.components.schemas[*].properties[*]~
warn
schema-type-defined
Component schemas should declare a type.
$.components.schemas[*]
warn
security-schemes-defined
Security schemes must be defined in components.
$.components
info
security-scheme-description
Each security scheme should be described.
$.components.securitySchemes[*]