tRPC · API Governance Rules
tRPC API Rules
Spectral linting rules defining API design standards and conventions for tRPC.
8 Rules
error 3
warn 2
Rule Categories
trpc
Rules
warn
trpc-operation-summary-title-case
Operation summaries must use Title Case
$.paths[*][*].summary
error
trpc-operation-tags-required
All operations must have at least one tag
$.paths[*][*]
warn
trpc-trpc-error-schema
Error responses must use the TRPCErrorResult schema
$.paths[*][*].responses[4*,5*].content.application/json.schema
error
trpc-success-response-defined
All operations should define a 200 success response
$.paths[*][get,post]
hint
trpc-procedure-path-format
tRPC procedure paths should use dot notation for nested routers (e.g., router.procedure) or flat names for root procedures
$.paths[*]~
error
trpc-batch-endpoint-post
Batch endpoints must use POST method
$.paths[/batch]
hint
trpc-query-uses-get
Query procedures should use GET method
$.paths[*]~
hint
trpc-input-query-param
GET operations should define an input query parameter
$.paths[*][get]