extends: spectral:oas rules: trpc-operation-summary-title-case: description: Operation summaries must use Title Case severity: warn given: "$.paths[*][*].summary" then: function: pattern functionOptions: match: "^([A-Z][a-z]* ?)+$" trpc-operation-tags-required: description: All operations must have at least one tag severity: error given: "$.paths[*][*]" then: field: tags function: truthy trpc-trpc-error-schema: description: Error responses must use the TRPCErrorResult schema severity: warn given: "$.paths[*][*].responses[4*,5*].content.application/json.schema" then: function: schema functionOptions: schema: type: object minProperties: 1 trpc-success-response-defined: description: All operations should define a 200 success response severity: error given: "$.paths[*][get,post]" then: field: responses function: schema functionOptions: schema: type: object minProperties: 1 trpc-procedure-path-format: description: >- tRPC procedure paths should use dot notation for nested routers (e.g., router.procedure) or flat names for root procedures severity: hint given: "$.paths[*]~" then: function: pattern functionOptions: match: "^(/[a-zA-Z0-9._-]+|/\\{procedure\\})$" trpc-batch-endpoint-post: description: Batch endpoints must use POST method severity: error given: "$.paths[/batch]" then: field: post function: truthy trpc-query-uses-get: description: Query procedures should use GET method severity: hint given: "$.paths[*]~" then: function: pattern functionOptions: notMatch: "^/batch$" trpc-input-query-param: description: GET operations should define an input query parameter severity: hint given: "$.paths[*][get]" then: field: parameters function: truthy