Tronald Dump · API Governance Rules
Tronald Dump API Rules
Spectral linting rules defining API design standards and conventions for Tronald Dump.
51 Rules
error 20
warn 21
info 10
Rule Categories
delete
error
external
get
info
no
openapi
operation
parameter
path
paths
query
response
schema
security
servers
tag
tags
Rules
error
info-title-prefix
Spec title MUST begin with 'Tronald Dump'.
$.info.title
error
info-description-required
API description MUST be present and at least 60 characters.
$.info.description
warn
info-contact-required
Contact block MUST be present with at least a name.
$.info.contact
warn
info-license-required
License block MUST be defined.
$.info.license
error
info-version-required
Spec version MUST be present.
$.info.version
error
openapi-version-3
Use OpenAPI 3.0.x or 3.1.x.
$.openapi
error
servers-required
At least one server URL MUST be defined.
$.servers
warn
servers-https
Server URLs MUST use https.
$.servers[*].url
warn
servers-description-required
Each server entry MUST include a description.
$.servers[*]
warn
paths-kebab-case-or-template
Path segments MUST be lowercase kebab-case or {snake_case} templates.
$.paths.*~
error
paths-no-trailing-slash
Paths MUST NOT end with a trailing slash.
$.paths.*~
error
paths-no-query-string
Paths MUST NOT contain a query string.
$.paths.*~
warn
paths-no-file-extensions
Paths SHOULD NOT carry file extensions (.json, .xml).
$.paths.*~
error
operation-operationid-required
Every operation MUST have an operationId.
$.paths.*[get,post,put,patch,delete]
error
operation-operationid-camel-case
operationId MUST be camelCase.
$.paths.*[get,post,put,patch,delete].operationId
warn
operation-operationid-verb-prefix
operationId SHOULD start with a verb (get, list, search, create, update, delete).
$.paths.*[get,post,put,patch,delete].operationId
error
operation-summary-required
Every operation MUST have a summary.
$.paths.*[get,post,put,patch,delete]
warn
operation-summary-prefix
Operation summaries SHOULD begin with 'Tronald Dump'.
$.paths.*[get,post,put,patch,delete].summary
error
operation-description-required
Every operation MUST have a description.
$.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
Every operation SHOULD include x-microcks-operation for mock compatibility.
$.paths.*[get,post,put,patch,delete]
warn
tags-global-defined
Top-level tags array MUST be defined.
$.tags
warn
tag-description-required
Every global tag MUST have a description.
$.tags[*]
warn
tag-title-case
Tag names MUST be Title Case (single capitalized word or capitalized words separated by spaces).
$.tags[*].name
error
parameter-description-required
Every parameter MUST have a description.
$.paths.*.*.parameters[*]
warn
parameter-snake-case
Parameter names MUST be snake_case.
$.paths.*.*.parameters[*].name
error
parameter-schema-required
Every parameter MUST have a schema with a type.
$.paths.*.*.parameters[*]
warn
parameter-pagination-standard
Pagination parameters MUST be named 'page' and 'size' (Tronald Dump convention).
$.paths.*.*.parameters[?(@.in=='query' && (@.name=='offset' || @.name=='limit' || @.name=='per_page' || @.name=='pageSize'))]
info
parameter-example-encouraged
Parameters SHOULD include an example value.
$.paths.*.*.parameters[*]
error
response-200-required
Every GET operation MUST define a 200 response.
$.paths.*.get.responses
warn
response-404-on-id-paths
Path operations with an ID parameter SHOULD define a 404 response.
$.paths[?(@property.match(/\{.+\}/))].*.responses
info
response-500-encouraged
Operations SHOULD document a 500 response.
$.paths.*[get,post,put,patch,delete].responses
error
response-description-required
Every response MUST have a description.
$.paths.*.*.responses.*
info
response-hal-content-type
Successful responses SHOULD use application/hal+json (HAL convention).
$.paths.*.*.responses[?(@property.match(/^2\d{2}$/))].content
info
response-example-encouraged
Responses SHOULD include at least one named example.
$.paths.*.*.responses.*.content.*
warn
schema-snake-case-properties
Schema property names MUST be snake_case (except HAL conventions _links, _embedded).
$.components.schemas.*.properties.*~
warn
schema-description-required
Top-level component schemas MUST have a description.
$.components.schemas.*
error
schema-type-required
Schemas MUST declare a type.
$.components.schemas.*
info
schema-id-suffix
Unique identifier properties SHOULD be named with an _id suffix.
$.components.schemas.*.properties[?(@property == 'id' || @property == 'identifier')]~
info
schema-hal-links-on-resources
Resource schemas SHOULD include a _links property for HAL hypermedia.
$.components.schemas[?(@property.match(/^(Quote|Author|Source|Tag)$/))].properties
info
security-not-required-public-api
Tronald Dump is a public, no-auth API. The global `security` field SHOULD be omitted.
$.security
error
get-no-request-body
GET operations MUST NOT define a request body.
$.paths.*.get
error
delete-no-request-body
DELETE operations MUST NOT define a request body.
$.paths.*.delete
error
no-empty-description
Descriptions MUST NOT be empty strings.
$..description
info
external-docs-encouraged
Spec SHOULD include externalDocs pointing at provider documentation.
$.externalDocs
warn
servers-expected-domain
Server URLs should be on the tronalddump.io 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')]
warn
schema-names-casing
Component schema names should be PascalCase (the dominant convention in this API).
$.components.schemas
info
schema-properties-casing
Schema properties should be snake_case (the dominant convention in this API).
$.components.schemas[*].properties
warn
error-schema-defined
A shared error schema (Error) should be defined for error payloads.
$.components.schemas