Getting started
Installation
Section titled “Installation”Install the CLI from crates.io:
cargo install oratorGenerating code
Section titled “Generating code”Point Orator at your OpenAPI 3.1 spec:
orator --output src/generated spec.yamlThis produces a set of Rust modules containing your request/response types, operation traits, and (if using axum) a ready-made router.
Implementing your API
Section titled “Implementing your API”Orator generates a trait per tag in your spec. You bring your own struct and implement the trait on it — that’s where your actual logic lives.
struct MyApi;
impl PetsApi for MyApi { type Error = MyError;
async fn list_pets( &self, _ctx: Context, params: ListPetsParams, ) -> Result<ListPetsResponse, Self::Error> { // your logic here Ok(ListPetsResponse::Ok(vec![])) }}What’s next?
Section titled “What’s next?”Have a look at the tennis club example for a more complete walkthrough.