Censys · API Governance Rules
Censys API Rules
Spectral linting rules defining API design standards and conventions for Censys.
31 Rules
error 8
warn 22
info 1
Rule Categories
deprecated
info
openapi
operation
parameter
paths
requestbody
response
schema
security
servers
tag
tags
Rules
warn
info-title-censys-prefix
API title must start with "Censys".
$.info.title
warn
info-description-required
API info.description is required.
$.info
error
info-version-required
API info.version is required.
$.info
warn
openapi-version-3-1
Censys APIs target OpenAPI 3.1.
$
error
servers-required
At least one server must be defined.
$
error
servers-https
Server URLs must use HTTPS.
$.servers[*].url
warn
servers-censys-host
Server URL should be a censys.io domain.
$.servers[*].url
warn
paths-kebab-case
Path segments should be kebab-case (or path parameters).
$.paths.*~
error
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths.*~
warn
paths-version-prefix
Censys paths must include a /v{n} or /api/v{n} version prefix.
$.paths.*~
error
operation-operationid-required
Every operation must have an operationId.
$.paths.*[get,post,put,patch,delete]
warn
operation-operationid-kebab
operationId should be kebab-case (Censys convention).
$.paths.*[get,post,put,patch,delete].operationId
error
operation-summary-required
Every operation must have a summary.
$.paths.*[get,post,put,patch,delete]
warn
operation-summary-title-case
Operation summary should be Title Case prefixed with "Censys".
$.paths.*[get,post,put,patch,delete].summary
warn
operation-description-required
Every operation should have a description.
$.paths.*[get,post,put,patch,delete]
warn
operation-tags-required
Every operation must declare at least one tag.
$.paths.*[get,post,put,patch,delete]
warn
tags-global-defined
Top-level tags array should be defined.
$
warn
tag-title-case
Tags should be Title Case (e.g. "Threat Hunting").
$.tags[*].name
warn
parameter-description-required
Parameters should have a description.
$.paths.*[get,post,put,patch,delete].parameters[*]
warn
parameter-snake-case
Parameter names should be snake_case (Censys convention).
$.paths.*[get,post,put,patch,delete].parameters[*].name
error
parameter-no-auth-query
Authentication tokens must not be sent in query parameters.
$.paths.*[get,post,put,patch,delete].parameters[?(@.in=='query')].name
warn
requestbody-json-content
Request bodies must offer application/json content.
$.paths.*[post,put,patch].requestBody.content
error
response-2xx-required
Operations must define at least one 2xx response.
$.paths.*[get,post,put,patch,delete].responses
warn
response-401-defined
Authenticated operations should document a 401 response.
$.paths.*[get,post,put,patch,delete].responses
info
response-429-defined
Operations should document a 429 rate-limit response.
$.paths.*[get,post,put,patch,delete].responses
warn
response-json-content
2xx responses should offer application/json content.
$.paths.*[get,post,put,patch,delete].responses[?(@property.match(/^2[0-9][0-9]$/))].content
warn
schema-property-snake-case
Schema properties must be snake_case.
$.components.schemas.*.properties.*~
warn
schema-type-required
Schemas must declare type or composition (oneOf/anyOf/allOf/$ref).
$.components.schemas.*
warn
security-personal-access-token-defined
PersonalAccessToken security scheme must be defined.
$.components.securitySchemes
warn
security-bearer-scheme
PersonalAccessToken must be HTTP bearer.
$.components.securitySchemes.PersonalAccessToken
warn
deprecated-documented
Deprecated operations should document migration in description.
$.paths.*[?(@.deprecated==true)]