Strapi · API Governance Rules
Strapi API Rules
Spectral linting rules defining API design standards and conventions for Strapi.
10 Rules
error 1
warn 5
info 4
Rule Categories
strapi
Rules
warn
strapi-operation-ids-camel-case
Strapi operationIds use camelCase (e.g., findEntries, createEntry, listAdminUsers). All operation IDs must follow camelCase convention.
$.paths[*][*].operationId
warn
strapi-tags-title-case
All OpenAPI tags must use Title Case (e.g., 'Content Entries', 'Admin Users', 'API Tokens').
$.tags[*].name
warn
strapi-api-paths-prefix
All content API paths must begin with /api/. Admin API paths must begin with /admin/. Strapi enforces this routing convention.
$.paths
info
strapi-bearer-auth-on-protected-endpoints
Protected Strapi endpoints must declare security using bearerAuth or adminBearerAuth schemes. Public endpoints explicitly set security to [].
$.paths[*][get,put,delete,patch]
info
strapi-response-data-wrapper
Strapi REST API list responses wrap results in a 'data' array with a 'meta' object containing pagination. Single-entry responses wrap the entry in a 'data' object.
$.paths[*][get].responses['200'].content['application/json'].schema.properties
info
strapi-document-id-param-name
Strapi v5 uses 'documentId' as the path parameter for content entry identifiers. Path parameters for individual entries must be named 'documentId' (not 'id') in REST API paths.
$.paths['/api/{pluralApiId}/{documentId}'][*].parameters[*]
info
strapi-pagination-parameters
Strapi list endpoints support both page-based (pagination[page] / pagination[pageSize]) and offset-based (pagination[start] / pagination[limit]) pagination. Both styles use bracket notation.
$.paths[*][get].parameters[*].name
warn
strapi-error-schema-shape
Strapi error responses follow a consistent shape with a top-level 'data' (null) property and an 'error' object containing 'status', 'name', 'message', and 'details'.
$.components.schemas.Error.properties
error
strapi-operation-summaries-present
All operations must have a summary. Strapi docs use action-noun format (e.g., 'List content entries', 'Create a content entry').
$.paths[*][get,post,put,delete,patch]
warn
strapi-upload-multipart
Strapi file upload endpoints must use multipart/form-data content type.
$.paths['/api/upload'][post].requestBody.content