FakerAPI · API Governance Rules
FakerAPI API Rules
Spectral linting rules defining API design standards and conventions for FakerAPI.
35 Rules
error 19
warn 14
info 2
Rule Categories
fakerapi
Rules
error
fakerapi-info-title
Info title must start with "FakerAPI".
$.info.title
error
fakerapi-info-description-required
Info description is required and must be at least 60 characters.
$.info.description
warn
fakerapi-info-contact-required
Info contact block must be defined.
$.info
error
fakerapi-openapi-version
OpenAPI version must be 3.0.x.
$.openapi
error
fakerapi-server-required
At least one server entry must be defined.
$.servers
error
fakerapi-server-https
Server URLs must use https.
$.servers[*].url
warn
fakerapi-server-includes-v1
FakerAPI server URL must include the /api/v1 prefix.
$.servers[*].url
error
fakerapi-path-kebab-case
Path segments must be lowercase kebab-case (resource nouns).
$.paths.*~
error
fakerapi-path-no-trailing-slash
Paths must not end with a trailing slash.
$.paths.*~
warn
fakerapi-path-plural-noun
Resource path segments should be plural nouns (addresses, books, ...).
$.paths.*~
error
fakerapi-operation-only-get
FakerAPI exposes only GET endpoints; other methods are not allowed.
$.paths[*]
error
fakerapi-operation-summary-required
Every operation must have a summary.
$.paths[*][get]
warn
fakerapi-operation-summary-title-case
Operation summaries should be in Title Case and start with a verb.
$.paths[*][get].summary
error
fakerapi-operation-description-required
Every operation must have a description.
$.paths[*][get]
error
fakerapi-operation-id-required
operationId is required on every operation.
$.paths[*][get]
error
fakerapi-operation-id-camel-case
operationId must be camelCase.
$.paths[*][get].operationId
warn
fakerapi-operation-id-list-prefix
FakerAPI operations are collections; operationId should start with "list".
$.paths[*][get].operationId
error
fakerapi-operation-tag-required
Every operation must declare at least one tag.
$.paths[*][get]
warn
fakerapi-tags-global-defined
Top-level tags array must be defined.
$.tags
error
fakerapi-tags-title-case
Top-level tag names must be Title Case (Addresses, Books, Companies, ...).
$.tags[*].name
warn
fakerapi-tags-description-required
Every top-level tag must have a description.
$.tags[*]
error
fakerapi-param-description-required
Every parameter must have a description.
$.paths[*][*].parameters[*]
warn
fakerapi-quantity-param-shape
The _quantity parameter must be an integer between 1 and 1000.
$..parameters[?(@.name=='_quantity')].schema
warn
fakerapi-locale-param-default
The _locale parameter should default to en_US.
$..parameters[?(@.name=='_locale')].schema
warn
fakerapi-seed-param-integer
The _seed parameter must be an integer for deterministic output.
$..parameters[?(@.name=='_seed')].schema
error
fakerapi-response-200-required
Every operation must define a 200 response.
$.paths[*][get].responses
error
fakerapi-response-content-json
Responses must be application/json.
$.paths[*][get].responses[*].content
warn
fakerapi-response-envelope
All responses must extend the standard FakerAPI envelope (status / code / locale / seed / total / data).
$.paths[*][get].responses[200].content.application/json.schema
warn
fakerapi-schema-property-naming
Schema property names must be lowercase camelCase or snake_case (the spec uses both, e.g. streetName + country_code).
$.components.schemas[*].properties.*~
warn
fakerapi-schema-id-integer
id properties must be integers.
$.components.schemas[*].properties.id
info
fakerapi-schema-description-recommended
Top-level schemas should have a description.
$.components.schemas[*]
error
fakerapi-no-security-required
FakerAPI is open and unauthenticated; the spec must not require security.
$
error
fakerapi-get-no-request-body
GET operations must not declare a requestBody.
$.paths[*][get]
warn
fakerapi-no-empty-descriptions
Descriptions must not be empty strings.
$..description
info
fakerapi-examples-encouraged
Each schema property should provide an example value.
$.components.schemas[*].properties[*]