crates.io · API Governance Rules
crates.io API Rules
Spectral linting rules defining API design standards and conventions for crates.io.
7 Rules
error 1
warn 3
info 1
Rule Categories
crates
oas3
operation
Rules
error
oas3-api-servers
All OpenAPI specs must declare at least one server.
warn
operation-tag-defined
Every operation must use a defined tag (Crates, Versions, Owners, Index, Config).
hint
crates-io-snake-case-fields
Response fields use snake_case as established by the crates.io Web API (e.g. max_version, recent_downloads).
$.components.schemas..properties.*~
warn
crates-io-title-case-summaries
Operation summaries use Title Case.
$.paths[*][*].summary
hint
crates-io-error-envelope
Error responses should reference the ErrorResponse schema with an errors[].detail envelope.
$.paths[*][*].responses[?(@property >= '400')].content.application/json.schema.$ref
info
crates-io-auth-header
Mutating Web API operations require the Authorization header (raw token, no Bearer prefix).
warn
crates-io-versioned-path
Web API paths are prefixed with /api/v1.
$.paths