Satay

Work in progress. We're focused on lta-rs-style clients right now: ergonomics that feel good in real code, validation that matches the spec. Other OpenAPI shapes come next, once we nail down what's supported and have tests to prove it.

sans-io OpenAPI 3.1 Rust 2024 MSRV 1.88

OpenAPI clients without picking a transport

Satay turns a spec into request builders, response decoders, and validation newtypes. You send the http::Request with reqwest, ureq, hyper, or whatever you already run.

Quick start

shell
cargo install satay-cli
Satay logo: cubes on a skewer, standing in for OpenAPI, codegen, and transport adapters

Features

Rust you can read, not template soup

One codegen output. Plug in reqwest, ureq, hyper, or your own client without keeping separate async, blocking, and WASM backends in sync (Haha get it? Nvm).

Sans-IO first

Actions build plain http::Request values. Send them with reqwest, ureq, hyper, tests, WASM, or whatever you already run.

Validation newtypes

String, number, integer, and array constraints from the spec become nutype newtypes. Bounds narrow to u8 when the maximum allows it.

OpenAPI 3.1

Reads the spec into a normalized IR, then emits structs, enums, builders, and decoders as ordinary Rust you can edit.

Optional adapters

Stay IO-free, or pull in satay-reqwest and satay-ureq when you want a short send_with call site.

Built with Satay

In the wild

Open-source API clients built with Satay. Got one? Send a PR.

Add your project

Fork the repo, add a row to website/src/data/users.ts with your name, description, and links. Logo goes in public/users/ if you have one; set logo in the entry.

How it works

Generate the client. Send it yourself.

  1. 01 Install the CLI and point it at your OpenAPI file.
  2. 02 Satay writes builders that produce IO-free http::Request values.
  3. 03 Send that request with reqwest, ureq, hyper, or your own client, then decode the response with the generated action types.
generate
$ satay generate --input openapi.yaml --output src/generated --rustfmt
$ satay --help