Cumulocity · API Governance Rules
Cumulocity API Rules
Spectral linting rules defining API design standards and conventions for Cumulocity.
12 Rules
error 4
warn 4
info 4
Rule Categories
cumulocity
Rules
warn
cumulocity-operation-summary-title-case
Every operation summary should use Title Case.
$.paths[*][get,post,put,delete,patch]
warn
cumulocity-operation-id-camel-case
operationId should be lowerCamelCase.
$.paths[*][get,post,put,delete,patch]
warn
cumulocity-tag-singular-noun
Tags should be human-readable, Title Case nouns describing a resource collection.
$.tags[*]
info
cumulocity-collection-paths-end-with-resource
Collection paths should reference the resource collection in plural form (managedObjects, measurements, events, alarms, operations, externalIds, users, groups, applications, options).
$.paths
info
cumulocity-content-type-vendor-json
Resource responses should use the application/vnd.com.nsn.cumulocity.* content type.
$.paths[*][get,post,put].responses[200,201].content
info
cumulocity-pagination-parameters
List operations should accept pageSize, currentPage, and withTotalPages query parameters.
$.paths[*].get.parameters
info
cumulocity-resource-self-link
Resource schemas should expose a `self` URI for HATEOAS navigation.
$.components.schemas[*].properties
warn
cumulocity-time-fields-iso8601
Time fields (time, creationTime, lastUpdated, firstOccurrenceTime, dateFrom, dateTo) should be RFC 3339 date-time strings.
$.components.schemas[*].properties[time,creationTime,lastUpdated,firstOccurrenceTime,dateFrom,dateTo]
error
cumulocity-alarm-severity-enum
Alarm severity must use the four canonical values.
$.components.schemas.Alarm.properties.severity
error
cumulocity-alarm-status-enum
Alarm status must use the three canonical values.
$.components.schemas.Alarm.properties.status
error
cumulocity-operation-status-enum
Operation status must use the four canonical values.
$.components.schemas.Operation.properties.status
error
cumulocity-security-defined
Every operation must declare security (basicAuth or bearerAuth).
$.paths[*][get,post,put,delete,patch]