RPC and event formats
Not every API is described in OpenAPI. JSON-RPC services publish OpenRPC, event-driven systems keep their CloudEvents in an xRegistry, and many services are defined in a cross-language IDL such as Thrift, FlatBuffers or Cap'n Proto. Apiome imports each of them into the Catalog with its own importer, so you can search, version, diff, lint and convert them next to your REST APIs.
Use this page to find the right importer. Each one has its own page with the details.
What you can import
| Source | What it is | Importer | Steps |
|---|---|---|---|
| OpenRPC | The description of a JSON-RPC 2.0 service, common across web3 | openrpc | Import an OpenRPC / JSON-RPC API |
| xRegistry | The CNCF CloudEvents catalog: schemas, message definitions and endpoints | xregistry | Import a CNCF xRegistry |
| CloudEvents | A single CloudEvent (specversion, type, source, data) | cloudevents | Import a CNCF xRegistry |
| Apache Thrift | Cross-language IDL and RPC (.thrift), one file or a set joined by include | thrift | Import an Apache Thrift API |
| FlatBuffers | A zero-copy binary schema (.fbs) | flatbuffers | Import a FlatBuffers or Cap'n Proto schema |
| Cap'n Proto | A zero-copy binary schema with RPC interfaces (.capnp) | capnproto | Import a FlatBuffers or Cap'n Proto schema |
| Connect RPC | A Protobuf contract served the Connect way, with an HTTP/JSON route per method | connectrpc | Import a Connect-RPC service |
| JSON Type Definition | A JTD schema (RFC 8927), imported as a data schema | jtd | JSON Type Definition |
JSON:API, HAL, HAL-FORMS, JSON-LD and Hydra are not imported on their own: they are conventions an OpenAPI, Swagger or RAML document follows. Apiome recognizes them when you import that document. See REST hypermedia conventions.
How it works
- Import the file. In Import to catalog, choose the format, or let Auto-detect find it,
and upload, paste or link the document. From the CLI, use
apiome import openrpc,apiome import thriftand so on. A Thrift IDL split across files, or a Buf module for Connect, goes in one archive (.zip,.tar.gz,.tar). - Or read it from a running service. Some formats can be fetched live:
- OpenRPC:
apiome import openrpc --discovercalls the service'srpc.discovermethod (Discover a live service). - Connect RPC: the contract is fetched over gRPC server reflection (Import it).
- xRegistry: a running registry is crawled, one catalog item per schema, message group and endpoint (What you can import).
- OpenRPC:
- It lands in the Catalog. Methods and messages become operations, and schemas, structs and tables become types. Each import is fingerprinted, so importing an unchanged document again does not create a new version.
- Compare versions by the format's own rules. Tick two versions on the catalog item's
Versions tab. Each format grades its changes by what breaks its clients:
- OpenRPC
- xRegistry
- Thrift
- FlatBuffers and Cap'n Proto, by field id
- Lint it. Each format has its own lint pack, on top of the checks every catalog item gets: OpenRPC, xRegistry, Thrift, FlatBuffers and Cap'n Proto, and the hypermedia conformance checks.
- Convert it when you're ready. Convert to OpenAPI turns the item into a publishable project and shows what the conversion keeps and loses before it creates anything (Convert to OpenAPI).
Find them in the catalog
On Bring in → Catalog, narrow by Formats to list the items of one importer. Items imported from an OpenAPI, Swagger or RAML document that follows a hypermedia convention can also be filtered by that convention (Filter the catalog by convention).
Going the other way
Every format on this page is also an export target: choose it from Export on a catalog item. OpenRPC, Thrift, FlatBuffers and Cap'n Proto can be written from an item of any format; see OpenRPC, Thrift, FlatBuffers and Cap'n Proto from any source. Supported formats lists the export support of the others.
Where next
- Supported formats: every format, the versions each importer reads, and export support.
- How importing works: every import source and import history.
- Convert to OpenAPI: what each format's conversion keeps.