TM Forum · API Governance Rules
TM Forum API Rules
Spectral linting rules defining API design standards and conventions for TM Forum.
38 Rules
error 9
warn 17
info 12
Rule Categories
delete
deprecation
error
examples
get
info
no
openapi
operation
parameter
path
paths
post
query
request
response
schema
security
servers
tag
Rules
error
info-title-required
Info object must have a title
$.info
warn
info-description-required
Info object must have a description of at least 20 characters
$.info
error
info-version-required
Info object must have a version
$.info
warn
openapi-version-3
Specs must use OpenAPI 3.x
$
error
servers-defined
Servers array must be defined and non-empty
$
warn
servers-https
Server URLs must use HTTPS
$.servers[*].url
warn
paths-kebab-case
Path segments must use kebab-case
$.paths[*]~
warn
paths-no-trailing-slash
Paths must not end with a trailing slash
$.paths[*]~
info
paths-versioned
Paths should include a version prefix
$.paths[*]~
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-description-required
Every operation should have a description
$.paths[*][get,post,put,patch,delete,head,options]
error
operation-operationid-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-operationid-camel-case
OperationId must 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]
info
operation-summary-tm-forum-prefix
Operation summaries should start with 'TM Forum'
$.paths[*][get,post,put,patch,delete,head,options].summary
info
tag-name-title-case
Tag names in the global tags array should use Title Case
$.tags[*].name
info
tag-description-required
All global tags should have a description
$.tags[*]
warn
parameter-description-required
All parameters must have a description
$.paths[*][get,post,put,patch,delete][parameters][*]
info
parameter-name-snake-case
Parameter names should use snake_case or camelCase
$.paths[*][get,post,put,patch,delete][parameters][*].name
warn
request-body-content-type-json
Request bodies should support application/json
$.paths[*][post,put,patch].requestBody.content
error
response-success-required
Operations must define at least one 2xx success response
$.paths[*][get,post,put,patch,delete].responses
error
response-description-required
All response objects must have a description
$.paths[*][get,post,put,patch,delete].responses[*]
info
response-400-defined
Operations should define a 400 Bad Request response
$.paths[*][post,put,patch].responses
info
response-401-defined
Operations should define a 401 Unauthorized response
$.paths[*][get,post,put,patch,delete].responses
info
schema-property-camel-case
Schema property names should use camelCase
$.components.schemas[*].properties[*]~
warn
schema-type-defined
Schema properties should have a type defined
$.components.schemas[*].properties[*]
info
schema-description-required
Top-level schemas should have a description
$.components.schemas[*]
warn
security-schemes-defined
Security schemes must be defined in components
$.components
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
info
post-has-request-body
POST operations creating resources should have a request body
$.paths[*].post
warn
no-empty-descriptions
Descriptions must not be empty strings.
$..description
warn
deprecation-documented
Deprecated operations should have a description explaining the deprecation
$.paths[*][get,post,put,patch,delete][?(@.deprecated==true)]
info
examples-encouraged
Schema properties are encouraged to have example values
$.components.schemas[*].properties[*]
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 camelCase (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