GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • oRPC
  • Documentation
  • Blog
  • Comparison
  • From V1
  • Sponsors
  • Experts
  • Releases
  • Discussions
  • LLM Context
  • LLM Context (Full)
  • V1 Documentation
  • Contract-First
  • Requirements

This view

  • Original page
  • New address

GeezerVison is showing orpc.dev — ArkType Integration - oRPC

On this page
  • Installation
  • JSON Schema Converter
  • Reusable Types

ArkType Integration

Use ArkType types directly in oRPC via Standard Schema, with a dedicated JSON Schema converter for OpenAPI generation and Smart Coercion.

ArkType implements Standard Schema, so procedures accept ArkType types without any converter. The converter below is only needed by tools that consume JSON Schema, such as OpenAPI generation and Smart Coercion.

Sponsors

ScreenshotOne.comThe screenshot API for developersYuzuWe're hiring NYC based engineersMisskeyHQDecentralized microblogging SNS born on Earth

Installation

npm install @orpc/arktype@beta arktype
pnpm add @orpc/arktype@beta arktype
yarn add @orpc/arktype@beta arktype
bun add @orpc/arktype@beta arktype
nub add @orpc/arktype@beta arktype
aube add @orpc/arktype@beta arktype

JSON Schema Converter

ArkTypeToJsonSchemaConverter wraps ArkType’s built-in toJsonSchema and adds support for additional types such as bigint, Date, File, and Blob. Use it with tools such as the OpenAPI Generator and Smart Coercion. It accepts the same options as ArkType’s toJsonSchema, see the source code and ArkType’s JSON Schema configuration docs for implementation details.

import { OpenAPIGenerator } from '@orpc/openapi'
import { ArkTypeToJsonSchemaConverter } from '@orpc/arktype'

const generator = new OpenAPIGenerator({
  converters: [new ArkTypeToJsonSchemaConverter()],
})

Enable the cache option to reuse conversion results when the same schema instance is converted repeatedly. When enabled, repeated conversions return the same JSON schema object, so treat the results as immutable.

const converter = new ArkTypeToJsonSchemaConverter({ cache: true })

Reusable Types

A common pattern is defining reusable or recursive types using scopes. The converter preserves them in $defs, which OpenAPIGenerator can then hoist into components.schemas.

import { scope } from 'arktype'

const types = scope({
  Planet: {
    name: 'string',
    neighbors: 'Planet[]',
  },
})

const PlanetSchema = types.export().Planet

Last updated on November 9, 2026

Was this page helpful?

Thanks for your feedback!

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.