Axway · API Governance Rules
Axway API Rules
Spectral linting rules defining API design standards and conventions for Axway.
40 Rules
error 13
warn 18
info 9
Rule Categories
error
info
microcks
naming
no
operation
operations
parameters
path
paths
query
request
responses
schema
schemas
security
servers
Rules
error
info-title-required
API spec must have a non-empty info.title
$.info
error
info-description-required
API spec must have an info.description
$.info
warn
info-version-semver
Info version should follow semantic versioning
$.info.version
warn
info-contact-required
API spec should include contact information
$.info
error
paths-lowercase
Path segments must be lowercase
$.paths
error
paths-no-trailing-slash
Paths must not end with a trailing slash
$.paths
warn
paths-kebab-or-lower
Path segments should use lowercase or snake_case (Axway convention)
$.paths
warn
paths-no-file-extensions
Paths should not include file extensions
$.paths
error
operations-operation-id-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
operations-operation-id-underscore
operationId should use underscore convention (resource_action)
$.paths[*][get,post,put,patch,delete].operationId
error
operations-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete]
warn
operations-description-required
Every operation must have a description
$.paths[*][get,post,put,patch,delete]
error
operations-tags-required
Every operation must have at least one tag
$.paths[*][get,post,put,patch,delete]
warn
operations-tags-lowercase
Tags should be lowercase (Axway convention)
$.paths[*][get,post,put,patch,delete].tags[*]
warn
parameters-description-required
Every parameter must have a description
$.paths[*][get,post,put,patch,delete].parameters[*]
error
parameters-schema-required
Every parameter must have a schema with type
$.paths[*][get,post,put,patch,delete].parameters[*]
info
parameters-camel-case
Parameter names should use camelCase or snake_case
$.paths[*][get,post,put,patch,delete].parameters[*].name
error
responses-success-required
Every operation must define a success response (2xx)
$.paths[*][get,post,put,patch,delete].responses
warn
responses-error-401
Operations with security should define a 401 response
$.paths[*][get,post,put,patch,delete].responses
info
responses-error-400
POST/PUT operations should define a 400 response
$.paths[*][post,put].responses
error
schemas-type-required
Every schema must declare a type
$.components.schemas[*]
info
schemas-description-recommended
Schemas should have a description
$.components.schemas[*]
info
schemas-properties-description
Schema properties should have descriptions
$.components.schemas[*].properties[*]
info
schemas-no-additional-properties-unset
Object schemas should explicitly set additionalProperties
$.components.schemas[?(@.type=='object')]
error
security-schemes-defined
API must define at least one security scheme
$.components
info
security-bearer-format
Bearer security schemes should specify bearerFormat
$.components.securitySchemes[?(@.scheme=='bearer')]
warn
security-oauth2-scopes
OAuth2 schemes should define scopes
$.components.securitySchemes[?(@.type=='oauth2')].flows[*]
warn
request-body-json
Request bodies should use application/json content type
$.paths[*][post,put,patch].requestBody.content
error
request-body-schema
Request body JSON content must have a schema
$.paths[*][post,put,patch].requestBody.content.application/json
warn
naming-schema-pascal-case
Schema names should use PascalCase
$.components.schemas
info
microcks-operation-extension
Operations should include x-microcks-operation for mock compatibility
$.paths[*][get,post,put,patch,delete]
info
microcks-response-examples
Success responses should include named examples for Microcks
$.paths[*][get,post,put,patch,delete].responses.200.content.application/json
error
servers-https-only
Server URLs must use HTTPS.
$.servers[*].url
warn
servers-expected-domain
Server URLs should be on the axway.com domain.
$.servers[*].url
warn
path-params-casing
Path parameters should be snake_case (the dominant convention in this API).
$.paths[*].parameters[?(@.in=='path')].name
warn
query-params-casing
Query parameters should be snake_case (the dominant convention in this API).
$.paths[*][get,post,put,patch,delete].parameters[?(@.in=='query')]
info
schema-properties-casing
Schema properties should be snake_case (the dominant convention in this API).
$.components.schemas[*].properties
warn
operation-security-required
Every operation should declare its security requirements.
$.paths[*][get,post,put,patch,delete]
warn
error-schema-defined
A shared error schema (Error) should be defined for error payloads.
$.components.schemas
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description