Skip to content

docs(effect): avoid onExcessProperty in the JSON Schema converter example - #2259

Merged
dinwwwh merged 5 commits into
mainfrom
claude/inspiring-ramanujan-kqcdbe
Oct 17, 2026
Merged

dinwwwh merged 5 commits into
mainfrom
claude/inspiring-ramanujan-kqcdbe

Conversation

@dinwwwh

@dinwwwh dinwwwh commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

The EffectSchemaToJsonSchemaConverter example in the Effect integration docs used onExcessProperty: 'error'. That option only changes the generated JSON Schema: the spec then says additionalProperties: false, but validation keeps Effect's default onExcessProperty: '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. onExcessProperty is still listed among the accepted converter options.

Notes

The branch history contains two earlier commits that changed toStandardSchema and 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

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
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@dinwwwh dinwwwh changed the title docs(content): update EffectSchemaToJsonSchemaConverter example docs(effect): avoid onExcessProperty in the JSON Schema converter example Oct 17, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Effect JSON Schema converter example — apps/content/docs/integrations/effect.mdx now passes generateDescriptions: true instead of onExcessProperty: 'error' to EffectSchemaToJsonSchemaConverter. 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.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pkg-pr-new

pkg-pr-new Bot commented Oct 17, 2026

Copy link
Copy Markdown
More templates

@orpc/ai-sdk

npm i https://pkg.pr.new/@orpc/ai-sdk@2259

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@2259

@orpc/bun

npm i https://pkg.pr.new/@orpc/bun@2259

@orpc/client

npm i https://pkg.pr.new/@orpc/client@2259

@orpc/cloudflare

npm i https://pkg.pr.new/@orpc/cloudflare@2259

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@2259

@orpc/experimental-effect

npm i https://pkg.pr.new/@orpc/experimental-effect@2259

@orpc/evlog

npm i https://pkg.pr.new/@orpc/evlog@2259

@orpc/hibernation

npm i https://pkg.pr.new/@orpc/hibernation@2259

@orpc/json-schema

npm i https://pkg.pr.new/@orpc/json-schema@2259

@orpc/experimental-lock

npm i https://pkg.pr.new/@orpc/experimental-lock@2259

@orpc/experimental-msw

npm i https://pkg.pr.new/@orpc/experimental-msw@2259

@orpc/nest

npm i https://pkg.pr.new/@orpc/nest@2259

@orpc/next

npm i https://pkg.pr.new/@orpc/next@2259

@orpc/node

npm i https://pkg.pr.new/@orpc/node@2259

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@2259

@orpc/opentelemetry

npm i https://pkg.pr.new/@orpc/opentelemetry@2259

@orpc/pinia-colada

npm i https://pkg.pr.new/@orpc/pinia-colada@2259

@orpc/pino

npm i https://pkg.pr.new/@orpc/pino@2259

@orpc/publisher

npm i https://pkg.pr.new/@orpc/publisher@2259

@orpc/ratelimit

npm i https://pkg.pr.new/@orpc/ratelimit@2259

@orpc/server

npm i https://pkg.pr.new/@orpc/server@2259

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@2259

@orpc/swr

npm i https://pkg.pr.new/@orpc/swr@2259

@orpc/tanstack-query

npm i https://pkg.pr.new/@orpc/tanstack-query@2259

@orpc/trpc

npm i https://pkg.pr.new/@orpc/trpc@2259

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@2259

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@2259

commit: ce031dc

@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dinwwwh
dinwwwh merged commit 0358bf8 into main Oct 17, 2026
11 checks passed
@codspeed

codspeed Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

⚠️ 5 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 28 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing claude/inspiring-ramanujan-kqcdbe (ce031dc) with main (e691289)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants