Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paperclip-rs/paperclip
WIP OpenAPI tooling for Rust.
https://github.com/paperclip-rs/paperclip
hacktoberfest openapi rust
Last synced: 13 days ago
JSON representation
WIP OpenAPI tooling for Rust.
- Host: GitHub
- URL: https://github.com/paperclip-rs/paperclip
- Owner: paperclip-rs
- License: apache-2.0
- Created: 2019-05-17T05:55:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-23T09:11:00.000Z (22 days ago)
- Last Synced: 2024-10-29T14:54:31.817Z (15 days ago)
- Topics: hacktoberfest, openapi, rust
- Language: Rust
- Homepage:
- Size: 20.7 MB
- Stars: 889
- Watchers: 11
- Forks: 117
- Open Issues: 92
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Paperclip
![Build Status](https://github.com/paperclip-rs/paperclip/actions/workflows/cicd.yml/badge.svg)
![Linter Status](https://github.com/paperclip-rs/paperclip/actions/workflows/linter.yml/badge.svg)
[![Usage docs](https://img.shields.io/badge/quickstart-blue.svg)](https://paperclip-rs.github.io/paperclip)
[![API docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://paperclip-rs.github.io/paperclip/paperclip)
[![Crates.io](https://img.shields.io/crates/v/paperclip.svg)](https://crates.io/crates/paperclip)Paperclip offers tooling for the [OpenAPI specification](https://github.com/OAI/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:
- [Examples and Usage](https://paperclip-rs.github.io/paperclip).
- [Features being worked on](https://github.com/paperclip-rs/paperclip/projects).
- [API documentation](https://paperclip-rs.github.io/paperclip/paperclip).## Developing locally
- Clone the repository along with its submodules using the following command:
```bash
git clone --recurse-submodules [email protected]:paperclip-rs/paperclip.git
```- Make sure you have [`rustup`](https://rustup.rs/) installed.
- Then move to repository:```bash
cd paperclip
```- Run the setup environment routine
```bash
make prepare
```- Build the project and run tests:
```bash
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](https://discord.gg/PPu4Dhj).
## Code of Conduct
This project follows the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct).
## License
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or )
- MIT license ([LICENSE-MIT](LICENSE-MIT) or )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](https://doc.rust-lang.org/reference/procedural-macros.html) 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](https://paperclip-rs.github.io/paperclip/build-script.html) instead and `include!` the relevant code. That said, [we're using proc-macros](./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.**