Acceptance Criteria · API Governance Rules
Acceptance Criteria API Rules
Spectral linting rules defining API design standards and conventions for Acceptance Criteria.
27 Rules
error 9
warn 14
info 4
Rule Categories
ac
Rules
error
ac-require-security-scheme
APIs managing acceptance criteria must require authentication
$.paths[*][get,post,put,patch,delete]
warn
ac-path-kebab-case
API paths must use kebab-case naming
$.paths[*]~
warn
ac-no-trailing-slash
API paths must not have trailing slashes
$.paths[*]~
error
ac-operations-require-summary
All operations must have a summary
$.paths[*][get,post,put,patch,delete]
error
ac-operations-require-operation-id
All operations must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
ac-operation-id-camel-case
OperationIds must use camelCase
$.paths[*][get,post,put,patch,delete].operationId
warn
ac-operations-require-tags
All operations must have at least one tag
$.paths[*][get,post,put,patch,delete]
info
ac-operations-require-description
All operations should have a description
$.paths[*][get,post,put,patch,delete]
error
ac-require-200-response
GET operations must define a 200 response
$.paths[*].get.responses
warn
ac-require-201-on-post
POST operations should define a 201 created response
$.paths[*].post.responses
warn
ac-require-401-response
Operations must define a 401 unauthorized response
$.paths[*][get,post,put,patch,delete].responses
warn
ac-require-404-on-parameterized-paths
Operations on parameterized paths must define a 404 response
$.paths[?(@~.match(/\{.*\}/))][get,put,patch,delete].responses
warn
ac-require-500-response
All operations must define a 500 server error response
$.paths[*][get,post,put,patch,delete].responses
warn
ac-schema-require-description
All schema components must have a description
$.components.schemas[*]
info
ac-schema-properties-require-description
Schema properties should have descriptions for self-documenting APIs
$.components.schemas[*].properties[*]
warn
ac-require-id-property
Resource schemas must include an id property
$.components.schemas[?([email protected] =~ /(List|Request)$/)]
error
ac-timestamp-format
Timestamp fields must use date-time format
$.components.schemas[*].properties[?(@.description =~ /[Tt]imestamp|At$|[Dd]ate/)]
info
ac-gherkin-given-when-then
Gherkin-format acceptance criteria must include given, when, and then fields
$.components.schemas.AcceptanceCriterion.properties
warn
ac-status-enum-values
Status fields must use defined enum values
$.components.schemas[*].properties.status
warn
ac-priority-enum-values
Priority fields must use defined enum values
$.components.schemas[*].properties.priority
error
ac-require-json-request-body
Request bodies must use application/json content type
$.paths[*][post,put,patch].requestBody.content
error
ac-require-json-response
Success responses must return application/json
$.paths[*][get,post,put,patch].responses[200,201].content
warn
ac-list-responses-require-total
List schema responses must include a total count
$.components.schemas[?(@.title =~ /List$/)]
warn
ac-list-responses-require-page
List schema responses must include page for pagination
$.components.schemas[?(@.title =~ /List$/)]
error
ac-info-require-version
API spec must include a version
$.info
error
ac-info-require-description
API spec must include a description
$.info
info
ac-info-require-contact
API spec should include contact information
$.info