Trustpilot · API Governance Rules
Trustpilot API Rules
Spectral linting rules defining API design standards and conventions for Trustpilot.
11 Rules
error 2
warn 9
Rule Categories
trustpilot
Rules
warn
trustpilot-operation-ids-camel-case
Trustpilot operation IDs must use camelCase format.
$.paths.*[get,post,put,patch,delete]
error
trustpilot-path-versioned
All Trustpilot API paths must be versioned with /v1/ prefix.
$.paths
error
trustpilot-private-paths-require-oauth
Trustpilot private endpoints (/v1/private/*) must require OAuth2 security.
$.paths['/v1/private/*'].*[get,post,put,patch,delete]
warn
trustpilot-public-paths-require-apikey
Trustpilot public endpoints should define API key authentication.
$.paths[?([email protected]('/v1/private/'))].*[get,post,put,patch,delete].parameters[?(@.name=='apikey')]
warn
trustpilot-business-unit-id-in-path
Business unit endpoints must use {businessUnitId} path parameter.
$.paths[?(@property.includes('business-units'))]
warn
trustpilot-review-id-in-path
Review-specific endpoints must use {reviewId} path parameter.
$.paths[?(@property.includes('reviews') && [email protected]('/reviews'))]
warn
trustpilot-stars-integer
Star rating fields must be integer type with min 1, max 5.
$.components.schemas.*.properties.stars
warn
trustpilot-responses-have-200
GET operations must define a 200 response.
$.paths.*[get]
warn
trustpilot-date-time-format
Date/time fields in Trustpilot schemas must use date-time format.
$.components.schemas.*.properties[createdAt,updatedAt,preferredSendTime]
warn
trustpilot-operations-have-tags
All Trustpilot operations should be tagged.
$.paths.*[get,post,put,patch,delete]
warn
trustpilot-kebab-case-paths
Trustpilot path segments must use kebab-case.
$.paths