这是indexloc提供的服务,不要输入任何密码
Skip to content

u5surf/paperclip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paperclip

Build Status API docs

WIP OpenAPI code generator for Rust.

Features

The following features are supported at the moment:

  • Generate API objects from schemas in an OpenAPI v2 spec.

See the projects for tracking the features in queue.

Motivation

This project is inspired from go-swagger.

While Serde makes it amazingly easy to write API objects, only the official codegen supports generating proper APIs and leverages the builder pattern for building API requests. I think it should be really easy to build type-safe APIs from OpenAPI specifications using pure Rust.

Building

  • 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 really wish to contribute to this project but don't know how to begin or if you need help with something related to this project, then feel free to send me an email or ping me in Discord (same handle).

Code of Conduct

This project follows the Rust Code of Conduct.

License

Licensed under either of

at your option.

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.

About

WIP OpenAPI codegen for Rust.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.4%
  • Makefile 0.6%