pathbase-client
Auto-generated typed Rust client for the Pathbase HTTP API.
The client is derived at build time from openapi.json (committed alongside the crate) via progenitor. Spec drift surfaces as a cargo build failure rather than a runtime "HTML where JSON was expected" error.
What's in here
use Client;
let client = new;
// `client.health()`, `client.create_anon_path(...)`, `client.create_path(...)`, etc.
The full surface mirrors the OpenAPI document. Only the operations actually documented there are available. The CLI auth-redeem endpoint (POST /api/v1/auth/cli/redeem) is real in production but absent from the spec, so it is not present in this client — path-cli keeps a hand-rolled redeem implementation.
Build pipeline
- The committed spec is OAS 3.1; progenitor's
openapiv3dependency only understands 3.0. build.rsreads the spec, downgrades 3.1 idioms in-memory ("type": ["string", "null"]→"type": "string", "nullable": true; injects permissive schemas for empty media-type bodies), then hands the result toprogenitor::Generator.- The generated code lands in
$OUT_DIR/pathbase_client.rsand is included fromsrc/lib.rs.
Refreshing the spec
From the workspace root:
PATHBASE_URL=https://staging.example.com
The script overwrites crates/pathbase-client/openapi.json (the same file build.rs reads). After refresh, cargo build -p pathbase-client regenerates the client against the new spec.
License
Apache-2.0.