utoipa

Compile-time generated OpenAPI documentation for Rust APIs

Library
Cargo
v5.5.0
4,071stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
85/100Excellent
Development Activity84
Maintenance88
Community72
Maturity56
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
80/100Excellent
Architecture82
Code Quality84
Innovation80
Learning Curve74

utoipa generates OpenAPI 3.1 specifications directly from Rust source code at compile time, using derive macros on your existing structs and handler functions instead of a separate annotation DSL or runtime reflection. It integrates with popular Rust web frameworks including Actix Web, Axum, and Rocket, so route signatures and types become the single source of truth for the API schema.

Beyond raw spec generation, the workspace ships companion crates for serving interactive documentation UIs — Swagger UI, Redoc, RapiDoc, and Scalar — directly from the generated spec, and a config crate for customizing output, making it a complete compile-time OpenAPI toolchain rather than just a schema generator.

What You Get

  • Derive macros (ToSchema, #[utoipa::path], OpenApi) that generate OpenAPI 3.1 specs from existing Rust types and handlers
  • Framework integration crates (utoipa-axum, utoipa-actix-web) that wire routes directly into the generated spec
  • Bundled documentation UI crates: utoipa-swagger-ui, utoipa-redoc, utoipa-rapidoc, utoipa-scalar
  • A utoipa-config crate for customizing generation behavior without hand-editing macro output
  • Compile-time validation, so schema/route mismatches surface as build errors rather than runtime failures

Common Use Cases

  • Documenting a Rust REST API built with Actix Web or Axum without maintaining a hand-written OpenAPI YAML file
  • Serving an interactive Swagger UI or Scalar docs page directly from a Rust web service
  • Generating client-consumable OpenAPI specs as part of a CI pipeline for downstream SDK generation
  • Keeping API documentation in sync with code by deriving schemas from the same structs used at runtime

Under The Hood

Architecture utoipa is a Cargo workspace of ten member crates: the core utoipa crate defines the public traits/types (ToSchema, OpenApi) that the generated spec conforms to, utoipa-gen implements the proc-macros that do the actual compile-time code generation, and separate crates (utoipa-axum, utoipa-actix-web) adapt the generated spec to each web framework’s routing conventions, while utoipa-swagger-ui/-redoc/-rapidoc/-scalar each vendor a documentation UI and serve it from the spec. Tech Stack Pure Rust workspace (edition 2021, rust-version 1.88+) resolved with Cargo’s resolver v2; the proc-macro-heavy utoipa-gen crate is the most complex member at roughly 10k lines across the core utoipa crate’s source, with utoipa-swagger-ui-vendored bundling the Swagger UI static assets so no network fetch is needed at build or run time. Code Quality utoipa-gen/tests/ contains dedicated derive-macro test suites (openapi_derive_test.rs, path_derive_axum_test.rs, path_parameter_derive_test.rs) plus a testdata fixture directory, and workspace-level Clippy lints are enforced (including a guard against large stack allocations in generated code, tracked against a real regression issue) — indicating active attention to both correctness and generated-code efficiency. API Design The library favors deriving documentation from types Rust code already has (#[derive(ToSchema)] on existing structs, #[utoipa::path] on existing handlers) rather than requiring a parallel schema DSL, so adopting it in an existing Actix/Axum service is largely additive rather than a rewrite.

Used by 10 apps in this directory

TypeScript
53%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,252

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
68
Dependency
Built with
TypeScript53%
Rust35%
Updated today
Rust
86%
Other

Arroyo

Data Engineering · Analytics

5,029

A distributed stream processing engine written in Rust that lets you write SQL to run stateful, real-time computations over data streams with subsecond results.

View details
86
Repo Health
74
Technical
62
Dependency
Built with
Rust86%
Updated 3 days ago
Go
32%
Apache 2.0

CubeSandbox

Developer Tools · Security · AI Agents

11,816

Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.

View details
83
Repo Health
88
Technical
63
Dependency
Built with
Go32%
Rust28%
C23%
Updated yesterday
Rust
100%
Other

Meilisearch

Search

59,200

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
89
Repo Health
88
Technical
68
Dependency
Built with
Rust100%
Updated 4 days ago
Rust
100%
Other

Meilisearch

Search

59,200

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
89
Repo Health
88
Technical
68
Dependency
Built with
Rust100%
Updated 4 days ago
Rust
93%
Other

Tabby

AI Code Assistants

33,868

Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.

View details
60
Repo Health
78
Technical
61
Dependency
Built with
Rust93%
Updated 2 months ago
Rust
71%
MIT

Trieve

AI Development · Search · Developer Tools

2,717

All-in-one self-hostable platform for hybrid search, RAG, recommendations, and analytics built on Rust and Qdrant.

View details
43
Repo Health
74
Technical
64
Dependency
Built with
Rust71%
Updated 7 months ago
Rust
71%
MIT

Trieve

AI Development · Search · Developer Tools

2,717

All-in-one self-hostable platform for hybrid search, RAG, recommendations, and analytics built on Rust and Qdrant.

View details
43
Repo Health
74
Technical
64
Dependency
Built with
Rust71%
Updated 7 months ago
Rust
71%
MIT

Trieve

AI Development · Search · Developer Tools

2,717

All-in-one self-hostable platform for hybrid search, RAG, recommendations, and analytics built on Rust and Qdrant.

View details
43
Repo Health
74
Technical
64
Dependency
Built with
Rust71%
Updated 7 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search