SpaceX (Community API) · API Governance Rules
SpaceX (Community API) API Rules
Spectral linting rules defining API design standards and conventions for SpaceX (Community API).
32 Rules
error 10
warn 15
info 7
Rule Categories
spacex
Rules
warn
spacex-info-title
Title must start with "SpaceX" (community API convention).
$.info.title
error
spacex-info-description-required
Info description is required and must be non-trivial.
$.info
warn
spacex-info-license-apache2
License should be Apache 2.0 to match upstream project.
$.info.license.name
info
spacex-info-status-maintenance
Community SpaceX-API is in maintenance-only mode; mark with x-status.
$.info
error
spacex-openapi-version-3
Use OpenAPI 3.x.
$.openapi
error
spacex-servers-defined
At least one server must be defined.
$.servers
error
spacex-server-https
Hosted server URL must use HTTPS.
$.servers[*].url
info
spacex-server-spacexdata
Canonical hosted server is https://api.spacexdata.com.
$.servers[*].url
error
spacex-paths-versioned
All paths must be prefixed with /v4 or /v5.
$.paths.*~
warn
spacex-paths-kebab-case
Path segments use lowercase letters, digits, and hyphens only (kebab-case).
$.paths.*~
info
spacex-paths-plural-collections
Top-level resource collections should be plural nouns.
$.paths.*~
error
spacex-paths-no-trailing-slash
Paths must not end with a trailing slash.
$.paths.*~
error
spacex-operation-operationid
Every operation must have an operationId.
$.paths.*[get,post,put,patch,delete]
warn
spacex-operation-operationid-camelcase
operationId must be camelCase.
$.paths.*[get,post,put,patch,delete].operationId
warn
spacex-operation-summary
Every operation must have a summary in Title Case.
$.paths.*[get,post,put,patch,delete]
warn
spacex-operation-description
Every operation must have a description.
$.paths.*[get,post,put,patch,delete]
warn
spacex-operation-tags
Every operation must have at least one tag.
$.paths.*[get,post,put,patch,delete]
warn
spacex-tags-known
Operation tags should be one of the documented resource tags.
$.paths.*[get,post,put,patch,delete].tags[*]
warn
spacex-parameter-description
All parameters must have descriptions.
$.paths.*[get,post,put,patch,delete].parameters[*]
warn
spacex-parameter-id-snake-case
Path parameter names must be snake_case or single-word.
$.paths.*[get,post,put,patch,delete].parameters[?(@.in=='path')].name
warn
spacex-requestbody-json
Request bodies must offer application/json.
$.paths.*[post,put,patch].requestBody.content
error
spacex-response-success
Every operation must declare at least one 2xx response.
$.paths.*[get,post,put,patch,delete].responses
warn
spacex-response-description
Every response must have a description.
$.paths.*[get,post,put,patch,delete].responses.*
info
spacex-response-not-found
GET-by-id operations should declare a 404 response.
$.paths[?(@property =~ /\\{id\\}$/)].get.responses
warn
spacex-schema-snake-case-properties
Schema properties should be snake_case (mongoose model convention).
$.components.schemas.*.properties.*~
info
spacex-schema-id-property
Resource schemas should expose an `id` property (UUID).
$.components.schemas[?(@property =~ /^(Launch|Rocket|Capsule|Core|CrewMember|Dragon|Payload|Ship|Launchpad|Landpad|StarlinkSat|Roadster|Company|HistoryEvent)$/)].properties
warn
spacex-security-scheme-defined
At least one security scheme must be defined (for admin routes).
$.components.securitySchemes
info
spacex-security-spacex-key
Admin auth header is `spacex-key`.
$.components.securitySchemes[?(@.type=='apiKey' && @.in=='header')].name
error
spacex-get-no-requestbody
GET operations must not declare a requestBody.
$.paths.*.get
error
spacex-query-uses-post
/query endpoints must use POST (mongoose-paginate query body).
$.paths[?(@property =~ /\\/query$/)]
warn
spacex-no-empty-description
Descriptions must not be empty strings.
$..description
info
spacex-microcks-extension
Each operation should include x-microcks-operation for mocking.
$.paths.*[get,post,put,patch,delete]