oRPC Zod Smart Coercion

Installation
SKILL.md

Zod Smart Coercion

A plugin alternative to z.coerce that automatically converts inputs to the expected type without modifying the input schema.

In Zod v4, this plugin only supports discriminated unions. Regular unions are not coerced.

Installation

npm install @orpc/zod@latest

Setup

import { OpenAPIHandler } from '@orpc/openapi/fetch'
import { ZodSmartCoercionPlugin } from '@orpc/zod' // Zod v3
import { experimental_ZodSmartCoercionPlugin as ZodSmartCoercionPlugin } from '@orpc/zod/zod4' // Zod v4
Installs
First Seen
oRPC Zod Smart Coercion — ali-master/skills