16 releases (8 breaking)

0.9.4 Oct 23, 2024
0.9.1 Sep 10, 2024
0.8.2 Sep 27, 2023
0.8.0 Jan 14, 2023
0.3.0 Jul 30, 2019

#89 in Web programming

Download history 3111/week @ 2024-07-27 2757/week @ 2024-08-03 2292/week @ 2024-08-10 2490/week @ 2024-08-17 2381/week @ 2024-08-24 3190/week @ 2024-08-31 3686/week @ 2024-09-07 3394/week @ 2024-09-14 4073/week @ 2024-09-21 2736/week @ 2024-09-28 2753/week @ 2024-10-05 4247/week @ 2024-10-12 4951/week @ 2024-10-19 4382/week @ 2024-10-26 4537/week @ 2024-11-02 3914/week @ 2024-11-09

18,725 downloads per month
Used in 7 crates

MIT/Apache

8.5MB
50K SLoC

JavaScript 27K SLoC // 0.1% comments JSX 13K SLoC // 0.0% comments Rust 9K SLoC // 0.0% comments Handlebars 678 SLoC Mustache 524 SLoC Shell 112 SLoC // 0.1% comments Bitbake 51 SLoC // 0.1% comments

Paperclip

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

  • Clone the repository along with its submodules using the following command:

     git clone --recurse-submodules git@github.com:paperclip-rs/paperclip.git
    
  • Make sure you have rustup installed.

  • Then move to repository:

    cd paperclip
    
  • Run the setup environment routine

    make prepare
    
  • Build the project and run tests:

    make
    

Contributing

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.

License

Licensed under either of

at your option.

Sponsors

Folks who have sponsored for the development of this project:

FAQ

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.

Dependencies

~7–27MB
~418K SLoC