Skip to content
Back to skills

Orpc Expand Openapi Types

ASecurity

Extend OpenAPILink to support additional data types beyond JSON's native capabilities.

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 12, 2026
businessgitapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add ali-master/skills --skill orpc-expand-openapi-types --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Orpc Expand Openapi Types?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Orpc Expand Openapi Types
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ali-master-orpc-expand-openapi-types/badge)](https://www.skillsdirectory.com/skills/ali-master-orpc-expand-openapi-types)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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"
---

# Expanding Type Support for OpenAPI Link

Extend [OpenAPILink](/docs/openapi/client/openapi-link) to support additional data types using the [Response Validation Plugin](/docs/plugins/response-validation).

## How It Works

Extend your [output](/docs/procedure#input-output-validation) and [error](/docs/error-handling#type%E2%80%90safe-error-handling) schemas with coercion logic.

> Outputs containing `Blob` or `File` outside the root level also face [Bracket Notation](/docs/openapi/bracket-notation#limitations) limitations.

```ts
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:

```ts
const beforeValidation = {
  date: '2025-09-01T07:24:39.000Z',
  bigint: '123'
}
```

After validation (via Response Validation Plugin):

```ts
const afterValidation = {
  date: new Date('2025-09-01T07:24:39.000Z'),
  bigint: 123n
}
```

> To support more types than [OpenAPI Handler](/docs/openapi/openapi-handler#supported-data-types), first extend the [OpenAPI JSON Serializer](/docs/openapi/advanced/openapi-json-serializer).

## Setup

Set up the [Response Validation Plugin](/docs/plugins/response-validation) and remove the `JsonifiedClient` wrapper:

```diff
 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)
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.