Conversation
Input validation errors now send only `message` and `path` in `data.issues`,
with object path segments reduced to `{ key }`; raw issues stay on
`error.cause.issues`.
More templates
@orpc/ai-sdk
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/effect
@orpc/evlog
@orpc/hibernation
@orpc/json-schema
@orpc/experimental-lock
@orpc/mcp
@orpc/msw
@orpc/nest
@orpc/next
@orpc/node
@orpc/openapi
@orpc/experimental-openapi-inference
@orpc/opentelemetry
@orpc/pinia-colada
@orpc/pino
@orpc/publisher
@orpc/ratelimit
@orpc/server
@orpc/shared
@orpc/swr
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/zod
commit: |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
There was a problem hiding this comment.
ℹ️ No blocking issues — two minor suggestions inline.
Approach: sound — the projection happens where issues are put on the wire, so every server transport (RPC, OpenAPI, batch) gets it from one place, while raw issues remain on error.cause.
Reviewed changes
- Input issue projection:
validateInputmaps each Standard Schema issue to{ message, path }and reduces object path segments to{ key }, dropping embeddedinput, nestedissues, and segmentvaluebefore serialization. - Matching client shape:
RequestValidationLinkPluginapplies the same projection so locally thrownBAD_REQUESTerrors match server-produced ones. - Tests: two new cases cover dropping non-wire fields and normalizing
{ key }path segments. - Docs:
from-v1.mdxnotes the narroweddata.issuesshape and points aterror.cause.issues.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
| issues: result.issues.map((issue) => ({ | ||
| message: issue.message, | ||
| path: issue.path?.map((segment) => | ||
| typeof segment === 'object' ? { key: segment.key } : segment, | ||
| ), | ||
| })), |
There was a problem hiding this comment.
The v1 counterpart fix (#2567) keeps every top-level scalar field (code, type, expected, …) and only drops object/array fields, so a Zod issue on v1 still exposes code while the same issue on v2 loses it. Those scalars are exactly the safe part — nested input/issues are what caused the blowup — so keeping them costs nothing and avoids v1 and v2 exposing different data.issues shapes for the same error. Unless the narrower v2 shape is deliberate, align this with v1 and state the shape in the migration entry.
| issues: result.issues.map((issue) => ({ | ||
| message: issue.message, | ||
| path: issue.path?.map((segment) => | ||
| typeof segment === 'object' ? { key: segment.key } : segment, | ||
| ), | ||
| })), |
There was a problem hiding this comment.
This projection is duplicated verbatim from validateInput in packages/server/src/procedure-client.ts, and this copy has no test — request-validation.test.ts only asserts expect.any(Array). A change to the public issue shape now has to be made in two packages with nothing catching drift; consider one helper exported from @orpc/contract (next to ValidationError or in schema-utils.ts) and asserting its output once.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
orpc | 45b4e5a | Commit Preview URL Branch Preview URL |
Nov 29 2026, 02:22 PM |
Follow-up to #2568. - Move the validation issue mapping into `toPublicSchemaIssue` in `@orpc/contract`, used by `validateInput` in the server and by `RequestValidationLinkPlugin`. - Remove the migration-guide note, since v1 ships the same change.
#2576) Reverts the fallback added in #2570. When `codec.encodeError` throws, `StandardHandler.handle` now rejects with that error instead of returning a plain `INTERNAL_SERVER_ERROR`. - The fallback hid the failure: it was only recorded on the span, which most users don't have. - It saved nothing: the expensive part (e.g. a stack overflow) has already happened by then. - Validation issues no longer echo input (#2568, #2570), so an encoding failure is now usually a bug in the app's error data, which should surface to root interceptors, logging plugins and the server framework. - The error is still recorded on the span when it propagates.

Input validation errors put the raw Standard Schema issues into
error.data.issues. Valibot and ArkType issues embed the input (input, nestedissues, path segments withinputandvalue). So a deeply nested input made the serializer overflow the stack andhandler.handle()reject, and a large input gave a response that grows with the square of its size.Each issue on the wire now keeps only
messageandpath, where object segments become{ key }. Raw issues stay onerror.cause(ValidationError).RequestValidationLinkPluginsends the same shape, so client-side errors match the server's.Tests in
procedure-client.test.tscover the issue shape and the{ key }path segments. The v2 migration guide notes the change. The v1 fix is in #2567.