The Racing API · API Governance Rules
The Racing API API Rules
Spectral linting rules defining API design standards and conventions for The Racing API.
28 Rules
error 9
warn 11
info 8
Rule Categories
get
info
no
openapi
operation
parameter
paths
response
schema
security
servers
Rules
error
info-title-required
Info object must have a title
$.info
warn
info-description-required
Info object must have a description with minimum length
$.info
error
info-version-required
API version must be defined
$.info
warn
openapi-version-31
OpenAPI version should be 3.1.x
$
error
servers-defined
Servers array must be defined and non-empty
$
error
servers-https
Server URLs must use HTTPS
$.servers[*].url
warn
paths-kebab-case
Path segments must use kebab-case
$.paths[*]~
warn
paths-no-trailing-slash
Paths must not have trailing slashes
$.paths[*]~
info
paths-versioned
Paths should include version prefix /v1/
$.paths[*]~
error
operation-summary-required
Operations must have a summary
$.paths[*][get,post,put,delete,patch]
warn
operation-description-required
Operations must have a description
$.paths[*][get,post,put,delete,patch]
error
operation-operationId-required
Operations must have an operationId
$.paths[*][get,post,put,delete,patch]
warn
operation-tags-required
Operations must have at least one tag
$.paths[*][get,post,put,delete,patch]
info
operation-summary-provider-prefix
Operation summaries should start with 'The Racing API'
$.paths[*][get,post,put,delete,patch].summary
warn
parameter-description-required
Parameters must have descriptions
$.paths[*][get,post,put,delete,patch].parameters[*]
info
parameter-snake-case
Query parameter names should use snake_case
$.paths[*][get,post,put,delete,patch].parameters[?(@.in=='query')].name
warn
parameter-apikey-not-in-query
API keys should be in headers not query parameters
$.paths[*][get,post,put,delete,patch].parameters[?(@.name=='api_key' || @.name=='apikey')]
error
response-success-required
Operations must have at least one 2xx response
$.paths[*][get,post,put,delete,patch].responses
warn
response-description-required
Response objects must have a description
$.paths[*][get,post,put,delete,patch].responses[*]
info
response-404-for-id-paths
Endpoints with path parameters should have a 404 response
$.paths[~*{*}*][get].responses
info
response-422-validation-error
The Racing API uses 422 for validation errors
$.paths[*][get,post,put,delete,patch].responses
warn
schema-type-defined
Schema objects should have a type defined
$.components.schemas[*]
info
schema-description-required
Top-level schemas should have a description
$.components.schemas[*]
error
security-schemes-defined
Security schemes must be defined in components
$.components
info
security-basic-auth
The Racing API uses HTTP Basic authentication
$.components.securitySchemes[*]
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
warn
no-empty-descriptions
Descriptions must not be empty strings
$..description
info
operation-examples-encouraged
Operations should have examples for mock server compatibility
$.paths[*][get,post,put,delete,patch].responses[*].content[*]