Numbers API · API Governance Rules
Numbers API API Rules
Spectral linting rules defining API design standards and conventions for Numbers API.
37 Rules
error 16
warn 16
info 5
Rule Categories
examples
global
info
no
only
openapi
operation
parameter
paths
response
schema
security
servers
tag
Rules
warn
info-title-prefix
Info title must start with "Numbers API".
$.info.title
error
info-description-required
A non-empty info.description is required.
$.info
info
info-contact-email
Info contact must include an email.
$.info.contact
warn
info-license-required
Info license block must be present.
$.info
error
openapi-version-3
Spec must be OpenAPI 3.0.x.
$.openapi
error
servers-defined
At least one server must be defined.
$
error
servers-url-required
Each server entry must define a url.
$.servers[*]
warn
servers-description-required
Each server entry should include a description.
$.servers[*]
error
paths-lowercase
Path segments must be lowercase.
$.paths.*~
error
paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths.*~
error
paths-no-query-string
Paths must not embed query strings.
$.paths.*~
warn
paths-no-version-prefix
Numbers API paths are unversioned; do not introduce /v1, /v2 prefixes.
$.paths.*~
error
operation-summary-required
Every operation must have a summary.
$.paths.*[get,post,put,patch,delete,options,head]
warn
operation-summary-prefix
Operation summaries should start with "Numbers API".
$.paths.*[get,post,put,patch,delete,options,head].summary
warn
operation-description-required
Every operation must have a description.
$.paths.*[get,post,put,patch,delete,options,head]
error
operation-operationid-required
Every operation must have an operationId.
$.paths.*[get,post,put,patch,delete,options,head]
error
operation-operationid-camelcase
operationIds must be camelCase.
$.paths.*[get,post,put,patch,delete,options,head].operationId
warn
operation-operationid-verb-prefix
operationIds should start with a recognized verb.
$.paths.*[get,post,put,patch,delete,options,head].operationId
error
operation-tags-required
Every operation must declare at least one tag.
$.paths.*[get,post,put,patch,delete,options,head]
warn
global-tags-defined
A global tags array must be defined.
$
warn
tag-description-required
Each global tag must include a description.
$.tags[*]
warn
tag-title-case
Tag names must be Title Case (single word per tag).
$.tags[*].name
warn
parameter-description-required
Every parameter must include a description.
$..parameters[*]
warn
parameter-name-lowercase
Query and path parameter names must be lowercase (matches the API's style: `json`, `fragment`, `notfound`, `min`, `max`, `callback`, `write`, `default`).
$..parameters[?(@.in == 'query' || @.in == 'path')].name
error
parameter-required-flag-on-path
Path parameters must declare required:true.
$..parameters[?(@.in == 'path')]
info
parameter-example-recommended
Query parameters should include an example.
$..parameters[?(@.in == 'query')]
error
response-success-required
Every operation must declare a 2xx response.
$.paths.*[get,post,put,patch,delete,options,head].responses
error
response-description-required
Every response must include a description.
$..responses[*]
warn
response-plaintext-content
200 responses should include a text/plain representation (Numbers API default).
$.paths.*[get].responses[200].content
info
response-json-content
200 responses should also include an application/json representation.
$.paths.*[get].responses[200].content
error
no-request-body-on-get
GET operations must not declare a request body.
$.paths.*.get
warn
schema-property-snake-or-camel
Schema property names should be lowercase camelCase or snake_case; Numbers API's `Fact` object uses lowercase single-word fields (`text`, `number`, `found`, `type`, `date`, `year`).
$.components.schemas.*.properties.*~
warn
schema-types-defined
Every schema must declare a type.
$.components.schemas.*
warn
schema-description-required
Top-level schemas must include a description.
$.components.schemas.*
info
security-not-required
Numbers API is a free public API; do not declare global security requirements that would imply authentication.
$
error
only-get-methods
Numbers API exposes only GET endpoints. Do not introduce POST/PUT/PATCH/ DELETE operations.
$.paths.*[post,put,patch,delete]
info
examples-encouraged
200 responses should include named examples.
$.paths.*[get].responses[200].content.application/json