Unity · API Governance Rules
Unity API Rules
Spectral linting rules defining API design standards and conventions for Unity.
16 Rules
error 7
warn 7
info 1
Rule Categories
unity
Rules
error
unity-paths-start-with-version
All Unity API paths must start with a version prefix (e.g., /v1/, /v2/, /v3/)
$.paths[*]~
warn
unity-paths-use-kebab-case
Unity API path segments must use kebab-case (lowercase with hyphens)
$.paths[*]~
error
unity-no-trailing-slash
Paths must not have a trailing slash
$.paths[*]~
hint
unity-project-environment-paths
Paths that contain projectId or environmentId must include both
$.paths[*]~
error
unity-operation-id-format
Operation IDs must use camelCase
$.paths[*][*].operationId
error
unity-operation-id-required
All Unity API operations must have an operationId
$.paths[*][*]
error
unity-success-response-required
All operations must document at least one 2xx success response
$.paths[*][*].responses
warn
unity-401-response-on-secured-endpoints
Protected Unity endpoints should document 401 Unauthorized responses
$.paths[*][post,put,patch,delete].responses
info
unity-bearer-auth-scheme
Unity APIs use Bearer JWT tokens for authentication
$.components.securitySchemes[*]
error
unity-info-description
API info must include a description
$.info
warn
unity-info-version
API must have a version in semver-like format
$.info.version
warn
unity-external-docs
Unity APIs should link to their documentation pages
$
warn
unity-response-schema-defined
All 2xx responses should have defined schemas
$.paths[*][*].responses[?(@property.match(/^2/))].content.application/json
warn
unity-parameters-have-description
All path and query parameters should have descriptions
$.paths[*][*].parameters[?(@.in == 'path' || @.in == 'query')]
error
unity-operations-have-tags
All Unity operations must be tagged for grouping in documentation
$.paths[*][*]
warn
unity-tags-title-case
Unity API tags must use Title Case
$.paths[*][*].tags[*]