Expand description
§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 pathbase_client::Client;
let client = Client::new("https://pathbase.dev");
// `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:
scripts/refresh-pathbase-openapi.sh # defaults to https://pathbase.dev
PATHBASE_URL=https://staging.example.com scripts/refresh-pathbase-openapi.shThe 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.
Modules§
- prelude
- Items consumers will typically use such as the Client.
- types
- Types used as operation parameters and responses.
Structs§
- Byte
Stream - Untyped byte stream used for both success and error responses.
- Client
- Client for Pathbase API
- Response
Value - Typed value returned by generated client methods.
Enums§
- Error
- Error produced by generated client methods.
Traits§
- Client
Info - Interface for which an implementation is generated for all clients.