8 releases (5 breaking)

0.6.1 Oct 15, 2021
0.6.0 Oct 14, 2021
0.5.0 Nov 29, 2020
0.4.1 Jul 1, 2020
0.1.0 Jun 12, 2019

#88 in Development tools

Download history 1407/week @ 2021-08-17 1392/week @ 2021-08-24 1799/week @ 2021-08-31 2305/week @ 2021-09-07 2098/week @ 2021-09-14 1055/week @ 2021-09-21 2024/week @ 2021-09-28 2250/week @ 2021-10-05 2608/week @ 2021-10-12 2716/week @ 2021-10-19 1193/week @ 2021-10-26 1203/week @ 2021-11-02 1078/week @ 2021-11-09 1172/week @ 2021-11-16 1260/week @ 2021-11-23 1046/week @ 2021-11-30

4,836 downloads per month

MIT/Apache

8.5MB
49K SLoC

JavaScript 26K SLoC // 0.1% comments JSX 13K SLoC // 0.0% comments Rust 9K SLoC // 0.0% comments Handlebars 680 SLoC Shell 112 SLoC // 0.1% comments Happy 90 SLoC

Paperclip

Build Status 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.

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

~6–14MB
~321K SLoC