feat(zod): support JSON schema registries#1695
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — added v1-style typed JSON Schema registries to @orpc/zod so users can customize generated schemas, with direction-specific registries taking precedence over the general one.
- Added
JSON_SCHEMA_REGISTRY,JSON_SCHEMA_INPUT_REGISTRY, andJSON_SCHEMA_OUTPUT_REGISTRYbacked by Zod's nativeregistry()helper. - Updated
ZodToJsonSchemaConverterto merge registry entries over generated schemas viaObject.assignduringtoJSONSchema'soverridecallback. - Made
JsonSchema<Value = any>generic so registry entries can type-checkexamples/defaultagainst a schema's input/output shape. - Added runtime tests for merging, direction precedence, and nested-schema application, plus type tests for registry value shapes.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
More templates
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/experimental-effect
@orpc/evlog
@orpc/json-schema
@orpc/nest
@orpc/next
@orpc/openapi
@orpc/opentelemetry
@orpc/pinia-colada
@orpc/pino
@orpc/publisher
@orpc/ratelimit
@orpc/server
@orpc/shared
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/zod
commit: |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the follow-up commit added the missing json-schema-typed dependency to @orpc/zod and refreshed pnpm-lock.yaml so the registry types resolve correctly for consumers.
- Added
json-schema-typed@^8.0.2topackages/zod/package.json. - Updated
pnpm-lock.yamlwith the new importer entry.
Kimi K2 (free via Pullfrog for OSS) | 𝕏

Brings the v1
JSON_SCHEMA_REGISTRY,JSON_SCHEMA_INPUT_REGISTRY, andJSON_SCHEMA_OUTPUT_REGISTRYto@orpc/zodv2, so users can customize the generated JSON schema per Zod schema.$input/$output, soexamples,default, etc. are checked against the schema's input/output types.