HaveIBeenPwned · API Governance Rules
HaveIBeenPwned API Rules
Spectral linting rules defining API design standards and conventions for HaveIBeenPwned.
12 Rules
error 5
warn 7
Rule Categories
hibp
Rules
error
hibp-operation-summary-required
Every operation MUST have a summary string using Title Case.
$.paths[*][get,post,put,patch,delete]
warn
hibp-operation-description-required
Every operation MUST have a description.
$.paths[*][get,post,put,patch,delete]
error
hibp-operation-id-required
Every operation MUST declare an operationId.
$.paths[*][get,post,put,patch,delete]
warn
hibp-operation-tag-required
Every operation MUST be tagged exactly once.
$.paths[*][get,post,put,patch,delete]
error
hibp-api-key-security-scheme
HIBP authenticated endpoints MUST use the hibp-api-key header security scheme.
$.components.securitySchemes.ApiKeyAuth
warn
hibp-user-agent-documented
The info.description SHOULD remind clients of the mandatory user-agent header.
$.info.description
warn
hibp-401-on-authenticated-paths
Authenticated endpoints SHOULD document a 401 response.
$.paths[?(@property != '/breaches' && @property != '/dataclasses' && @property != '/latestbreach' && @property.indexOf('/breach/') < 0)][get,post,put,patch,delete].responses
warn
hibp-429-rate-limit-response
Authenticated endpoints SHOULD document a 429 Too Many Requests response.
$.paths[*][get].responses
warn
hibp-pascal-case-schemas
Schema names MUST be PascalCase.
$.components.schemas[*]~
warn
hibp-path-lowercase
HIBP path segments MUST be lowercase (the API is case-insensitive but canonical form is lowercase).
$.paths[*]~
error
hibp-contact-required
info.contact MUST be present and include a URL.
$.info.contact
error
hibp-license-required
HIBP API MUST be tagged with the CC 4.0 license.
$.info.license