Amnic · API Governance Rules
Amnic API Rules
Spectral linting rules defining API design standards and conventions for Amnic.
31 Rules
error 15
warn 15
info 1
Rule Categories
examples
get
info
no
openapi
operation
parameter
paths
request
response
schema
security
servers
tags
Rules
warn
info-title-prefix
API title should start with "Amnic".
$.info.title
error
info-description-required
API info must have a description of at least 20 characters.
$.info
error
info-version-required
API info must define a version.
$.info
warn
info-contact-required
API info should include contact information.
$.info
error
openapi-version-3
OpenAPI version must be 3.0.x.
$.openapi
error
servers-defined
At least one server must be defined.
$
error
servers-https
Server URLs must use HTTPS.
$.servers[*].url
warn
servers-description
Each server should have a description.
$.servers[*]
warn
paths-kebab-case
Path segments should use kebab-case (lowercase with hyphens).
$.paths[*]~
error
paths-no-trailing-slash
Paths must not have trailing slashes.
$.paths[*]~
error
operation-summary-required
Every operation must have a summary.
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-summary-prefix
Operation summaries should start with "Amnic".
$.paths[*][get,post,put,patch,delete,head,options].summary
warn
operation-description-required
Every operation should have a description.
$.paths[*][get,post,put,patch,delete,head,options]
error
operation-id-required
Every operation must have an operationId.
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-id-camel-case
operationId should use camelCase.
$.paths[*][get,post,put,patch,delete,head,options].operationId
error
operation-tags-required
Every operation must have at least one tag.
$.paths[*][get,post,put,patch,delete,head,options]
warn
tags-global-defined
Global tags array should be defined.
$
warn
tags-description
Global tags should have descriptions.
$.tags[*]
error
parameter-description-required
Every parameter must have a description.
$.paths[*][*].parameters[*]
warn
parameter-snake-case
Query and path parameter names should use snake_case or kebab-case.
$.paths[*][*].parameters[?(@.in == 'query')].name
warn
request-body-content-type
Request bodies should use application/json content type.
$.paths[*][post,put,patch].requestBody.content
error
response-success-required
Every operation must have at least one 2xx response.
$.paths[*][get,post,put,patch,delete]
warn
response-401-required
Operations with security should document a 401 response.
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
Every response must have a description.
$.paths[*][*].responses[*]
warn
schema-description-required
Top-level schemas should have a description.
$.components.schemas[*]
warn
schema-property-snake-case
Schema property names should use snake_case.
$.components.schemas[*].properties[*]~
error
security-scheme-defined
Security schemes must be defined in components.
$.components
warn
security-global-defined
Global security should be defined.
$
error
get-no-request-body
GET operations must not have a request body.
$.paths[*].get
error
no-empty-descriptions
Descriptions must not be empty strings.
$..description
info
examples-encouraged
Operations should include examples for better documentation.
$.paths[*][*].responses[*].content[*]