orpc-expanding-openapi-link-types
Extend OpenAPILink to support additional data types beyond JSON's native capabilities.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Extend OpenAPILink to support additional data types beyond JSON's native capabilities.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Quick reference for Better Notify configuration, patterns, and common gotchas
Interactive setup wizard for adding Better Notify to a TypeScript/JavaScript project
Context and API guidance for Better Notify — end-to-end typed notification infrastructure for Node.js
Seamlessly use AI SDK inside your oRPC projects without any extra overhead.
Use oRPC inside an Astro project.
Functions to encode and decode base64url strings (URL-safe variant of base64).
| name | oRPC Expanding OpenAPI Link Types |
| description | Extend OpenAPILink to support additional data types beyond JSON's native capabilities. |
| license | MIT |
| metadata | {"author":"Ali Torki","homepage":"https://github.com/ali-master","version":"1.0.0"} |
Extend OpenAPILink to support additional data types using the Response Validation Plugin.
Extend your output and error schemas with coercion logic.
Outputs containing
BloborFileoutside the root level also face Bracket Notation limitations.
const contract = oc.output(z.object({
date: z.coerce.date<Date>(),
bigint: z.coerce.bigint<bigint>(),
}))
const procedure = implement(contract).handler(() => ({
date: new Date(),
bigint: 123n,
}))
The client receives:
const beforeValidation = {
date: '2025-09-01T07:24:39.000Z',
bigint: '123'
}
After validation (via Response Validation Plugin):
const afterValidation = {
date: new Date('2025-09-01T07:24:39.000Z'),
bigint: 123n
}
To support more types than OpenAPI Handler, first extend the OpenAPI JSON Serializer.
Set up the Response Validation Plugin and remove the JsonifiedClient wrapper:
import type { ContractRouterClient } from '@orpc/contract'
import { createORPCClient } from '@orpc/client'
import { OpenAPILink } from '@orpc/openapi-client/fetch'
import { ResponseValidationPlugin } from '@orpc/contract/plugins'
const link = new OpenAPILink(contract, {
url: 'http://localhost:3000/api',
plugins: [
+ new ResponseValidationPlugin(contract),
]
})
-const client: JsonifiedClient<ContractRouterClient<typeof contract>> = createORPCClient(link)
+const client: ContractRouterClient<typeof contract> = createORPCClient(link)