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)