HashiCorp Consul · API Governance Rules
HashiCorp Consul API Rules
Spectral linting rules defining API design standards and conventions for HashiCorp Consul.
8 Rules
error 3
warn 3
info 2
Rule Categories
consul
Rules
error
consul-info-contact
API contact information must be present.
$.info
warn
consul-server-base-path
Server URLs must include /v1 base path.
$.servers[*].url
error
consul-token-security
A Consul token security scheme (apiKey via X-Consul-Token) must be defined.
$.components.securitySchemes[*]
error
consul-operation-id
Every operation must declare a unique operationId.
$.paths[*][get,post,put,patch,delete]
warn
consul-operation-tags
Operations must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
info
consul-dc-parameter
Operations that target a specific datacenter should accept a `dc` query parameter.
$.paths[?(@property.match(/(catalog|health|kv|acl|connect|config)/))].get
warn
consul-error-responses
Mutating operations should declare 4xx/5xx error responses.
$.paths[*][post,put,patch,delete].responses
info
consul-blocking-query-index
List endpoints should support blocking queries via an `index` parameter.
$.paths[?(@property.match(/(catalog\/services|catalog\/nodes|health\/service|kv)/))].get