TM Forum · API Governance Rules
TM Forum API Rules
Spectral linting rules defining API design standards and conventions for TM Forum.
34 Rules
error 10
warn 13
info 11
Rule Categories
delete
deprecation
examples
get
info
no
openapi
operation
parameter
paths
post
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
error
no-empty-descriptions
Description fields must not be empty strings
$.info.description$.paths[*][get,post,put,patch,delete].description$.components.schemas[*].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[*]