Back to skills
SKILL.md
Orpc Openapi Json Serializer
ASecurityExtend or override the standard OpenAPI JSON serializer.
- 8 stars
- 0 votes
- 0 copies
- 2 views
- Added September 12, 2026
Works with
Security analysis
100/100npx -y skills add ali-master/skills --skill orpc-openapi-json-serializer --agent claude-codeAre you the author of Orpc Openapi Json Serializer?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ali-master-orpc-openapi-json-serializer)---
name: oRPC OpenAPI JSON Serializer
description: Extend or override the standard OpenAPI JSON serializer.
license: MIT
metadata:
author: Ali Torki
homepage: https://github.com/ali-master
version: "1.0.0"
---
# OpenAPI JSON Serializer
Processes JSON payloads for [OpenAPIHandler](/docs/openapi/openapi-handler) and supports [native data types](/docs/openapi/openapi-handler#supported-data-types).
## Extending Native Data Types
1. **Define Your Custom Serializer:**
```ts
import type { StandardOpenAPICustomJsonSerializer } from '@orpc/openapi-client/standard'
export class User {
constructor(
public readonly id: string,
public readonly name: string,
public readonly email: string,
public readonly age: number,
) {}
toJSON() {
return { id: this.id, name: this.name, email: this.email, age: this.age }
}
}
export const userSerializer: StandardOpenAPICustomJsonSerializer = {
condition: data => data instanceof User,
serialize: data => data.toJSON(),
}
```
2. **Use Your Custom Serializer:**
```ts
import { OpenAPIHandler } from '@orpc/openapi/fetch'
import { OpenAPIGenerator } from '@orpc/openapi'
const handler = new OpenAPIHandler(router, {
customJsonSerializers: [userSerializer],
})
const generator = new OpenAPIGenerator({
customJsonSerializers: [userSerializer],
})
```
> Add custom serializers to `OpenAPIGenerator` for consistent serialization in the OpenAPI document.
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.