oRPC OpenAPI to Contract

Generate an oRPC contract from an existing OpenAPI specification with Hey API.

SKILL.md

GitHub

OpenAPI to Contract

If you have an OpenAPI Specification, use Hey API's orpc plugin to generate an oRPC contract.

The Hey API orpc plugin is currently beta.

Example

npm install -D @hey-api/openapi-ts
// openapi-ts.config.ts
import { defineConfig } from '@hey-api/openapi-ts'

export default defineConfig({
  input: 'https://get.heyapi.dev/hey-api/backend',
  output: 'src/client',
  plugins: [
    {
      name: 'orpc',
      validator: { input: 'zod' },
    },
  ],
})

Then run:

npx @hey-api/openapi-ts

What To Do Next