Repository navigation
docs(effect): avoid onExcessProperty in the JSON Schema converter example - #2259
Conversation
Effect's `Schema.toStandardSchemaV1` reports a defect during decoding (a transformation or check that throws) as an issue whose message is `Cause.pretty(cause)`. oRPC returned it to the client as a 400 `BAD_REQUEST`, exposing the thrown message and a stack trace with absolute server paths. `toStandardSchema` now installs its own `~standard.validate`: schema issues are formatted as before, while defects and interruptions are rethrown so oRPC reports them as a generic 500 `INTERNAL_SERVER_ERROR`, matching other schema libraries. The validator is attached to a fresh schema instance with the same AST, so the input schema (including global ones such as `Schema.String`) is no longer mutated, and hidden meta plugins are copied onto it. Docs now recommend `toStandardSchema` over `Schema.toStandardSchemaV1`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QomZJfoX2GAPyCVumY6vbX
…put extension `toStandardSchema` accepts an optional second argument with the same `leafHook`, `checkHook`, and `parseOptions` options as Effect's `Schema.toStandardSchemaV1`. Previously there was no way to pass them, and since Effect attached `~standard` in place with first-wins semantics, options given to a later conversion were silently ignored. The `.input`/`.output` extension leaves schemas already converted by `toStandardSchema` unchanged, so per-schema options are kept, and `setInputOutputExtensionOptions` sets the options used for the rest. Docs explain that `EffectSchemaToJsonSchemaConverter` options such as `onExcessProperty: 'error'` only affect the generated spec, and how to apply the same option to validation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QomZJfoX2GAPyCVumY6vbX
Reverts 32f19c8 ("feat(effect): support options in `toStandardSchema` and the input/output extension") and 35dcd29 ("fix(effect): stop leaking defects raised during schema validation"). This branch now only addresses the JSON Schema Converter docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QomZJfoX2GAPyCVumY6vbX
… validation The converter example used `onExcessProperty: 'error'`, which makes the generated spec say `additionalProperties: false` while validation keeps Effect's default `'ignore'` and silently strips extra keys. Use `generateDescriptions` in the example instead, and explain how to apply `onExcessProperty: 'error'` to validation as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QomZJfoX2GAPyCVumY6vbX
Converter options are documented as `Schema.toJsonSchemaDocument` options, so they only affect the generated JSON Schema; the example no longer uses `onExcessProperty`, so the extra warning is unnecessary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QomZJfoX2GAPyCVumY6vbX
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
orpc | ce031dc | Commit Preview URL Branch Preview URL |
Oct 17 2026, 02:24 AM |
onExcessProperty in the JSON Schema converter example
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Effect JSON Schema converter example —
apps/content/docs/integrations/effect.mdxnow passesgenerateDescriptions: trueinstead ofonExcessProperty: 'error'toEffectSchemaToJsonSchemaConverter. The old option only shaped the generated JSON Schema (additionalProperties: false) without affecting runtime validation, so the copyable example produced a spec that disagreed with the server; the replacement has no validation counterpart and avoids the mismatch.
I verified the claim against packages/effect/src/converter.ts: options are forwarded only to EffectSchema.toJsonSchemaDocument, while validation goes through toStandardSchemaV1, so onExcessProperty here cannot influence decoding. The surrounding prose (L312) still lists onExcessProperty among accepted options, which remains accurate since the converter does accept it.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
More templates
@orpc/ai-sdk
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/experimental-effect
@orpc/evlog
@orpc/hibernation
@orpc/json-schema
@orpc/experimental-lock
@orpc/experimental-msw
@orpc/nest
@orpc/next
@orpc/node
@orpc/openapi
@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: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance
|

Summary
The
EffectSchemaToJsonSchemaConverterexample in the Effect integration docs usedonExcessProperty: 'error'. That option only changes the generated JSON Schema: the spec then saysadditionalProperties: false, but validation keeps Effect's defaultonExcessProperty: 'ignore', so a request with extra keys still returns 200 and the extra keys are silently stripped. Copying the example therefore produced a spec that disagrees with the server.The example now uses
generateDescriptions: true, which only affects the generated JSON Schema and has no validation counterpart.onExcessPropertyis still listed among the accepted converter options.Notes
The branch history contains two earlier commits that changed
toStandardSchemaand a revert of both. The net diff is the one-line docs change above, so squash-merging is recommended.🤖 Generated with Claude Code
https://claude.ai/code/session_01QomZJfoX2GAPyCVumY6vbX