Skip to content
Back to skills

Orpc Openapi Json Serializer

ASecurity

Extend or override the standard OpenAPI JSON serializer.

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • 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-openapi-json-serializer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Orpc Openapi Json Serializer?

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

Security grade badge for Orpc Openapi Json Serializer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ali-master-orpc-openapi-json-serializer/badge)](https://www.skillsdirectory.com/skills/ali-master-orpc-openapi-json-serializer)

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 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

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.