Target Generators
Target Generators
Section titled “Target Generators”This page summarizes the targets currently supported built-in by xidlc and their typical use cases.
Built-in Targets
Section titled “Built-in Targets”| Target | Common Aliases | Artifact Type | Typical Combination |
|---|---|---|---|
rust |
rs |
Rust types and modules | Rust libraries or applications |
rust-jsonrpc |
rust_jsonrpc, rs_jsonrpc, rs-jsonrpc |
Rust JSON-RPC bindings | xidl-jsonrpc |
rust-axum |
rust_axum, axum, rs_axum, rs-axum |
Rust HTTP / Stream bindings | xidl-rust-axum |
typescript |
ts |
TypeScript declarations and Schemas | Frontend or toolchains |
typescript-rest |
typescript_rest, ts-rest, ts_rest |
TypeScript REST client/server bindings | xidl-typescript-server |
go |
golang |
Go types or auxiliary code | Go projects |
go-rest |
go_rest |
Go HTTP bindings | Go HTTP services |
openapi |
None | openapi_{filename}.json |
Documentation and downstream consumption |
openrpc |
open-rpc |
openrpc_<stem>.json |
JSON-RPC documentation |
--client and --server
Section titled “--client and --server”Some generators support distinguishing between client and server artifacts, such as:
rust-axumrust-jsonrpctypescript-rest
If a target does not support this distinction, these parameters may be ignored or have no significant effect.
typescript-rest defaults to client-only generation. Use --server for
server-only output, or --client --server to generate both sides.
When to Choose Which Target
Section titled “When to Choose Which Target”- Only data structures: Choose
rust,typescript, orgo. - HTTP service capabilities: Choose
rust-axum,go-rest, ortypescript-rest. - JSON-RPC: Choose
rust-jsonrpc. - Publishing HTTP contracts externally: Choose
openapi. - Publishing JSON-RPC contracts externally: Choose
openrpc. - Debugging internal representations: Choose
hir,rest-hir, ortyped-ast.
Schema File Output
Section titled “Schema File Output”In addition to generating code, XIDL can also generate OpenAPI and OpenRPC files suitable for HTTP and JSON-RPC:
openapiopenrpc