Transit · API Governance Rules
Transit API Rules
Spectral linting rules defining API design standards and conventions for Transit.
Transit API Rules is a Spectral governance ruleset published by Transit on the APIs.io network, containing 9 lint rules.
The ruleset includes 2 error-severity rules, 5 warning-severity rules, and 2 hint-severity rules.
Tagged areas include Public Transit, Real-Time, Trip Planning, Multimodal, and GTFS.
Rulesets can be applied to your own OpenAPI specs via Spectral to enforce the same governance standards.
9 Rules
error 2
warn 5
Rule Categories
transit
Rules
warn
transit-operation-summary-title-case
All operation summaries must use Title Case
$.paths[*][*].summary
error
transit-operationid-required
All operations must have an operationId
$.paths[*][*]
warn
transit-operationid-kebab-case
OperationIds should use camelCase
$.paths[*][*].operationId
warn
transit-tags-required
All operations must have tags
$.paths[*][*]
warn
transit-coordinates-lat-lon
Latitude and longitude parameters should be named lat and lon
$.paths[*][*].parameters[*].name
error
transit-response-200-required
All GET operations must have a 200 response
$.paths[*].get.responses
warn
transit-api-key-auth
API must use apiKey authentication
$.components.securitySchemes[*]
hint
transit-stop-codes-plural
Stop code query parameters should use plural form stop_codes
$.paths[*][*].parameters[*][?(@.in=='query' && @.name=='stop_code')]
hint
transit-pagination-limit-param
Collection endpoints should support limit parameter for pagination
$.paths[*].get.parameters[*][?(@.name=='max_departures' || @.name=='limit')]