OpenAPI
Serve oRPC procedures as a REST API, generate an OpenAPI 3.x document from the same code, call it with a typed client, and render interactive API docs.
The same router can serve the RPC protocol for oRPC clients and a REST API for everyone else. Add routing metadata, serve it with the OpenAPI Handler, and generate the OpenAPI document from the same code.
Define Routes
- Routing: set methods, paths, path parameters, and prefixes.
- Input and Output Mapping: map params, query, headers, and body to input and output.
- Bracket Notation: encode nested data in query strings and form data.
Serve
- OpenAPI Handler: expose procedures as HTTP endpoints on any HTTP adapter.
- OpenAPI Serializer: how
Date,BigInt, and files become JSON-friendly.
Document
- OpenAPI Specification: generate an OpenAPI 3.0, 3.1, or 3.2 document.
- Scalar (Swagger): serve an interactive API reference, or use the OpenAPI Reference Plugin.
Call
- OpenAPI Link: a typed client for any OpenAPI-compliant server.
- Expanding Type Support for OpenAPI Link: restore
Date,bigint, and other native types on the client. - OpenAPI Link Without Runtime Imports: embed the contract at build time.
To go the other way, generate a contract from OpenAPI.