Abstract API · API Governance Rules

Abstract API API Rules

Spectral linting rules defining API design standards and conventions for Abstract API.

34 Rules error 17 warn 11 info 6
View Rules File View on GitHub

Rule Categories

delete generated get info no openapi operation parameter paths response schema security servers tags

Rules

error
info-title-required
Info title must be present and start with "Abstract API"
$.info
error
info-description-required
Info description must be present
$.info
error
info-version-required
Info version must be present
$.info
error
openapi-version-3
Must use OpenAPI 3.0.x
$
error
servers-required
At least one server must be defined
$
error
servers-https-only
All server URLs must use HTTPS
$.servers[*]
warn
servers-abstractapi-domain
Server URLs should be under abstractapi.com domain
$.servers[*]
warn
paths-kebab-case
Path segments must use kebab-case (lowercase with hyphens)
$.paths
warn
paths-no-trailing-slash
Paths must not have trailing slashes (except root /)
$.paths
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete]
warn
operation-summary-title-case
Operation summary must start with "Abstract API"
$.paths[*][get,post,put,patch,delete]
error
operation-description-required
Every operation must have a description
$.paths[*][get,post,put,patch,delete]
error
operation-id-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
operation-id-camel-case
operationId must use camelCase
$.paths[*][get,post,put,patch,delete]
error
operation-tags-required
Every operation must have at least one tag
$.paths[*][get,post,put,patch,delete]
info
operation-microcks-extension
Operations should have x-microcks-operation extension for mock server compatibility
$.paths[*][get,post,put,patch,delete]
warn
tags-title-case
Tags should use Title Case
$.tags[*]
error
parameter-description-required
Every parameter must have a description
$.paths[*][get,post,put,patch,delete].parameters[*]
warn
parameter-api-key-query
Abstract API uses api_key as the query parameter name for authentication
$.paths[*][get,post,put,patch,delete].parameters[?(@.name == "api_key")]
error
parameter-schema-required
Every parameter must have a schema with type
$.paths[*][get,post,put,patch,delete].parameters[*]
info
parameter-example-recommended
Parameters should have example values
$.paths[*][get,post,put,patch,delete].parameters[*]
error
response-success-required
Every operation must have a 2xx success response
$.paths[*][get,post,put,patch,delete].responses
warn
response-401-required
Operations secured with API key should document 401 response
$.paths[*][get,post,put,patch,delete].responses
info
response-429-recommended
Rate-limited APIs should document 429 response
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
Every response must have a description
$.paths[*][get,post,put,patch,delete].responses[*]
info
schema-property-description
Schema properties should have descriptions
$.components.schemas[*].properties[*]
info
schema-property-example
Schema properties should have example values
$.components.schemas[*].properties[*]
warn
schema-top-level-description
Top-level schemas should have descriptions
$.components.schemas[*]
error
security-schemes-defined
Security schemes must be defined in components
$
warn
security-api-key-scheme
Abstract API uses apiKey security scheme
$.components.securitySchemes[*]
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
warn
delete-no-request-body
DELETE operations should not have a request body
$.paths[*].delete
error
no-empty-descriptions
Descriptions must not be empty strings
$..description
info
generated-from-docs-marked
Generated specs should be marked with x-generated-from
$.info