Skip to content
Back to skills

Orpc Input Output Structure

ASecurity

Control how input and output data is structured in oRPC.

  • 8 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 12, 2026
toolsgit

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add ali-master/skills --skill orpc-input-output-structure --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Orpc Input Output Structure?

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

Security grade badge for Orpc Input Output Structure
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ali-master-orpc-input-output-structure/badge)](https://www.skillsdirectory.com/skills/ali-master-orpc-input-output-structure)

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 Input/Output Structure
description: Control how input and output data is structured in oRPC.
license: MIT
metadata:
  author: Ali Torki
  homepage: https://github.com/ali-master
  version: "1.0.0"
---

# Input/Output Structure

Control the organization of request inputs and response outputs using `inputStructure` and `outputStructure` options.

## Input Structure

### Compact Mode (default)

Combines path parameters with query/body data into a single object.

```ts
const compactMode = os.route({
  path: '/ping/{name}',
  method: 'POST',
})
  .input(z.object({
    name: z.string(),
    description: z.string().optional(),
  }))
```

### Detailed Mode

Provide an object with fields per request part:

* `params`: Path parameters
* `query`: Query string data
* `headers`: Headers
* `body`: Body data

```ts
const detailedMode = os.route({
  path: '/ping/{name}',
  method: 'POST',
  inputStructure: 'detailed',
})
  .input(z.object({
    params: z.object({ name: z.string() }),
    query: z.object({ search: z.string() }),
    body: z.object({ description: z.string() }).optional(),
    headers: z.object({ 'x-custom-header': z.string() }),
  }))
```

## Output Structure

### Compact Mode (default)

```ts
const compactMode = os.handler(async ({ input }) => {
  return { message: 'Hello, world!' }
})
```

### Detailed Mode

Returns an object with:

* `status`: Response status (200-399), defaults to `successStatus`
* `headers`: Custom headers
* `body`: Response body

```ts
const detailedMode = os
  .route({ outputStructure: 'detailed' })
  .handler(async ({ input }) => {
    return {
      headers: { 'x-custom-header': 'value' },
      body: { message: 'Hello, world!' },
    }
  })

const multipleStatus = os
  .route({ outputStructure: 'detailed' })
  .output(z.union([
    z.object({ status: z.literal(201), body: z.string() }),
    z.object({ status: z.literal(200), body: z.string() }),
  ]))
  .handler(async ({ input }) => {
    if (something) return { status: 201, body: 'created' }
    return { status: 200, body: 'updated' }
  })
```

## Initial Configuration

```ts
const base = os.$route({ inputStructure: 'detailed' })
```

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.