Spaceflight News · API Governance Rules
Spaceflight News API Rules
Spectral linting rules defining API design standards and conventions for Spaceflight News.
41 Rules
error 10
warn 24
info 7
Rule Categories
examples
get
info
openapi
operation
parameter
paths
response
schema
security
servers
tag
Rules
warn
info-title-spaceflight-news-prefix
API info.title should identify Spaceflight News API.
$.info
warn
info-description-required
API must have a substantive description (min 80 chars).
$.info
error
info-version-required
API must declare info.version.
$.info
warn
info-contact-required
API should provide an info.contact block.
$.info
warn
info-license-required
API should declare a license (SNAPI is AGPL-3.0).
$.info
warn
openapi-version-3-0
SNAPI specs should use OpenAPI 3.0.x.
$
error
servers-required
At least one server URL must be defined.
$
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*]
warn
servers-snapi-v4-host
Production server should be api.spaceflightnewsapi.net/v4.
$.servers[*]
warn
paths-lowercase-kebab
Path segments must be lowercase kebab-case (snake_case not allowed in path segments).
$.paths
error
paths-no-query-strings
Path keys must not contain query strings.
$.paths
info
paths-trailing-slash-snapi-style
SNAPI paths end with a trailing slash by convention (`/articles/`, `/blogs/`, `/reports/`, `/info/`).
$.paths
error
operation-operationid-required
Every operation must declare an operationId.
$.paths[*][get,post,put,patch,delete]
warn
operation-operationid-camel-case
operationId should be camelCase (e.g. listArticles, retrieveBlog).
$.paths[*][get,post,put,patch,delete]
error
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-snapi-prefix
Operation summaries should begin with "Spaceflight News" prefix.
$.paths[*][get,post,put,patch,delete]
warn
operation-description-required
Every operation must have a description.
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
Every operation must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
info
operation-microcks-extension
Operations should declare x-microcks-operation for mock-server compatibility.
$.paths[*][get,post,put,patch,delete]
warn
tag-global-defined
A global tags array should be defined at the document root.
$
warn
tag-description-required
Every global tag must have a description.
$.tags[*]
warn
tag-title-case-name
Tag names should be Title Case (Articles, Blogs, Reports, Info).
$.tags[*]
warn
parameter-description-required
Every parameter must have a description.
$..parameters[*]
warn
parameter-snake-case
Query/path parameter names should be snake_case (SNAPI convention).
$..parameters[?(@.in=='query' || @.in=='path')]
info
parameter-pagination-offset-limit
Pagination uses offset and limit (SNAPI convention) rather than page/size or cursor.
$..parameters[?(@.in=='query' && (@.name=='page' || @.name=='size' || @.name=='cursor'))]
warn
parameter-schema-type
Every parameter must have a schema with a type.
$..parameters[*].schema
error
response-200-required
GET operations must declare a 200 response.
$.paths[*].get.responses
warn
response-detail-404
Retrieve-by-id operations should declare a 404 response.
$.paths[?(@property.match(/\{id\}/))].get.responses
warn
response-description-required
Every response must have a description.
$.paths[*][get,post,put,patch,delete].responses[*]
warn
response-json-content-type
Successful responses should use application/json.
$.paths[*][get,post,put,patch,delete].responses["200","201"].content
warn
schema-property-snake-case
Schema properties should be snake_case (SNAPI convention).
$.components.schemas[*].properties
warn
schema-description-required
Top-level component schemas should have a description.
$.components.schemas[*]
error
schema-type-required
Schemas must declare a type.
$.components.schemas[*]
info
schema-id-readonly
id properties should be marked readOnly.
$.components.schemas[*].properties.id
info
schema-updated-at-readonly
updated_at properties should be marked readOnly.
$.components.schemas[*].properties.updated_at
warn
schema-timestamps-date-time
published_at and updated_at must use format date-time.
$.components.schemas[*].properties[published_at,updated_at]
warn
schema-url-format-uri
url and image_url properties must use format uri.
$.components.schemas[*].properties[url,image_url]
warn
schema-launch-uuid
launch_id must use format uuid.
$.components.schemas[*].properties.launch_id
info
security-public-api
SNAPI is a public open API; operations may declare empty security `- {}` to make this explicit.
$.paths[*][get,post,put,patch,delete]
error
get-no-request-body
GET operations must not have a request body.
$.paths[*].get
info
examples-encouraged
Schema properties should include an example value.
$.components.schemas[*].properties[*]