Skip to content
Back to skills

Orpc Openapi Routing

ASecurity

Configure procedure routing with HTTP methods, paths, and response statuses.

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
toolsgitapi

Works with

  • api

Security analysis

A100/100

Scanned September 12, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Orpc Openapi Routing?

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

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

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 Routing
description: Configure procedure routing with HTTP methods, paths, and response statuses.
license: MIT
metadata:
  author: Ali Torki
  homepage: https://github.com/ali-master
  version: "1.0.0"
---

# Routing

> Applies only when using [OpenAPIHandler](/docs/openapi/openapi-handler).

## Basic Routing

By default oRPC uses `POST`, builds paths from router keys, and returns `200` on success.

```ts
os.route({ method: 'GET', path: '/example', successStatus: 200 })
os.route({ method: 'POST', path: '/example', successStatus: 201 })
```

> `.route` can be called multiple times; each call spread-merges with existing.

## Path Parameters

```ts
os.route({ path: '/example/{id}' })
  .input(z.object({ id: z.string() }))

os.route({ path: '/example/{+path}' }) // Matches slashes
  .input(z.object({ path: z.string() }))
```

## Route Prefixes

```ts
const router = os.prefix('/planets').router({
  list: listPlanet,
  find: findPlanet,
  create: createPlanet,
})
```

> Prefix applies only to procedures with a `path`.

## Lazy Router

When combining a lazy router with OpenAPIHandler, a prefix is required:

```ts
const router = {
  planet: os.prefix('/planets').lazy(() => import('./planet'))
}
```

> If using [contract-first](/docs/contract-first/define-contract), the prefix requirement doesn't apply.

> Don't use `lazy` helper from `@orpc/server` here — it can't apply route prefixes.

## Initial Configuration

```ts
const base = os.$route({ method: 'GET' })
```

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.