11 unstable releases

0.6.2 Sep 27, 2023
0.6.0 Jan 14, 2023
0.5.2 Jul 27, 2022
0.4.1 Oct 15, 2021
0.1.0 Jul 30, 2019

#18 in #tooling

Download history 2346/week @ 2023-12-10 1808/week @ 2023-12-17 788/week @ 2023-12-24 1171/week @ 2023-12-31 2011/week @ 2024-01-07 3033/week @ 2024-01-14 3180/week @ 2024-01-21 2963/week @ 2024-01-28 2435/week @ 2024-02-04 2107/week @ 2024-02-11 2423/week @ 2024-02-18 2930/week @ 2024-02-25 3194/week @ 2024-03-03 3517/week @ 2024-03-10 3800/week @ 2024-03-17 2776/week @ 2024-03-24

13,356 downloads per month
Used in 6 crates (2 directly)




Build Status Linter Status Usage docs API docs Crates.io

Paperclip offers tooling for the OpenAPI specification. Once complete, it will provide:

  • Code generation for efficient, type-safe, compile-time checked HTTP APIs (server, client and CLI) in Rust.
  • Support for processing, validating and hosting OpenAPI spec.
  • Customization for spec and code generation.

It's currently under active development and may not be ready for production use just yet.

You may be interested in:

Developing locally

  • Make sure you have rustup installed. cd into this repository and run make prepare to setup your environment.
  • Now run make to build and run the tests.


This project welcomes all kinds of contributions. No contribution is too small!

If you want to contribute to this project but don't know how to begin or if you need help with something related to this project, feel free to send me an email (in Github profile) or join the Discord server.

Code of Conduct

This project follows the Rust Code of Conduct.


Licensed under either of

at your option.


Folks who have sponsored for the development of this project:


Why is this generating raw Rust code instead of leveraging procedural macros for compile-time codegen?

I don't think proc macros are the right way to go for REST APIs. We need to be able to see the generated code somehow to identify names, fields, supported methods, etc. With proc macros, you sorta have to guess.

This doesn't mean you can't generate APIs in compile-time. The only difference is that you'll be using build scripts instead and include! the relevant code. That said, we're using proc-macros for other things.

The error thrown at compile-time doesn't look like it's very useful. Isn't there a better way to do this?

None that I can think of, sadly.

New ideas are here needed.


Core structs and traits for paperclip.


~313K SLoC