FastDOL · API Governance Rules
FastDOL API Rules
Spectral linting rules defining API design standards and conventions for FastDOL.
32 Rules
error 8
warn 18
info 6
Rule Categories
info
no
openapi
operation
parameter
paths
request
response
schema
security
servers
Rules
error
info-title-fastdol-prefix
API title must start with "FastDOL".
$.info.title
warn
info-description-required
info.description is required and must be at least 40 characters.
$.info
error
info-version-required
info.version is required.
$.info
warn
info-contact-email
info.contact.email should be present.
$.info
info
info-terms-of-service
info.termsOfService should be present.
$.info
error
openapi-version-3
OpenAPI version must be 3.0.x or 3.1.x.
$.openapi
error
servers-required
At least one server must be defined.
$
error
servers-https-only
All server URLs must use HTTPS.
$.servers[*].url
warn
servers-fastdol-host
Production server URL should be api.fastdol.com.
$.servers[*].url
warn
paths-version-prefix
Public data paths must be prefixed with /v1/ (auth, dashboard, webhooks excepted).
$.paths[?([email protected](/^\/(auth|dashboard|webhooks)\b/))]~
warn
paths-kebab-case
Path segments must be lower-case kebab-case (snake_case forbidden).
$.paths[*]~
error
paths-no-trailing-slash
Path must not end with a trailing slash.
$.paths[*]~
error
operation-operationid-required
Every operation must declare an operationId.
$.paths[*][get,post,put,delete,patch]
warn
operation-operationid-snake-case
operationId must be snake_case (FastAPI default).
$.paths[*][get,post,put,delete,patch].operationId
warn
operation-summary-required
Every operation must declare a summary.
$.paths[*][get,post,put,delete,patch]
warn
operation-summary-fastdol-prefix
Operation summary must be Title Case and prefixed with "FastDOL".
$.paths[*][get,post,put,delete,patch].summary
warn
operation-tags-required
Every operation should be tagged.
$.paths[*][get,post,put,delete,patch]
info
operation-microcks-extension
Operation should declare x-microcks-operation for mock-server compatibility.
$.paths[*][get,post,put,delete,patch]
warn
parameter-description-required
Every parameter must declare a description.
$.paths[*][get,post,put,delete,patch].parameters[*]
warn
parameter-snake-case
Parameter names must be snake_case.
$.paths[*][get,post,put,delete,patch].parameters[?(@.in!='header')]
warn
parameter-pagination-offset-limit
Pagination must use the offset/limit pair (no page/per_page).
$.paths[*][get,post,put,delete,patch].parameters[*].name
warn
request-body-json-content
Request bodies must offer application/json (multipart for upload only).
$.paths[*][post,put,patch].requestBody.content
error
response-success-required
Every operation must declare a 2xx success response.
$.paths[*][get,post,put,delete,patch].responses
warn
response-401-on-protected
Operations behind auth (X-Api-Key) should declare a 401 response.
$.paths[?([email protected](/^\/(auth|webhooks|v1\/health|v1\/sitemap)\b/))][get,post,put,delete,patch].responses
info
response-429-rate-limit
Data endpoints should declare a 429 rate-limit response.
$.paths[?(@property.match(/^\/v1\//))][get,post].responses
info
response-422-validation
Operations with parameters should declare a 422 validation response.
$.paths[*][get,post,put,delete,patch].responses
warn
response-json-content
Responses must use application/json.
$.paths[*][get,post,put,delete,patch].responses[*].content
warn
schema-property-snake-case
Schema properties must be snake_case.
$.components.schemas[*].properties[*]~
info
schema-id-property-naming
Identifier properties must end in _id (e.g. employer_id, job_id, key_id).
$.components.schemas[*].properties[?(@property.match(/(Id|ID|^id)$/))]~
warn
security-x-api-key-header
Auth must be the X-Api-Key header (FastDOL convention).
$.components.securitySchemes[*]
warn
no-empty-description
Descriptions must not be empty strings.
$..description
info
operation-examples-encouraged
Responses are encouraged to include named examples (Microcks-compatible).
$.paths[*][get,post,put,delete,patch].responses[*].content[*]