#openapi #swagger #generator

bin+lib oapi_generator

Code generator for OpenAPI specifications

5 releases

new 0.0.5 Aug 3, 2020
0.0.4 Jul 30, 2020
0.0.3 Jul 30, 2020
0.0.2 Jul 13, 2020
0.0.1 Jun 5, 2020

#71 in Template engine

32 downloads per month

ISC license

46KB
1K SLoC

Rust 661 SLoC // 0.0% comments Handlebars 426 SLoC

oapi_generator

Generate code from OpenAPI specifications.

Forked from the original with the idea to make it into simple build-script crate as opposed to being a binary

To use it as a binary:

cargo run -- path-to-specification path-to-output

To use it inside a build script:

oapi_generator::generate_oapi_server_stubs(speification, destination)

The hosting crate should have the following crates inside its Cargo.toml:

reqwest = { version = "0.10.6", features = [ "json" ] }

async-std = "1.6.0"

serde = { version = "1.0.111", features = [ "derive" ] }

serde_json = "1.0.53"

serde_urlencoded = "0.6.1"

actix-multipart = "0.2.0"

async-trait = "0.1.33"

url = "2.1.1"

thiserror = "1.0.19"

displaydoc = "0.1.6"

Dependencies

~6.5MB
~137K SLoC