Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: poc openapi v3 codegen
Browse files Browse the repository at this point in the history
tiagolobocastro committed Jun 25, 2024
1 parent 6032584 commit 6a3854c
Showing 328 changed files with 32,571 additions and 29 deletions.
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ required-features = ["cli"]
paperclip-actix = { path = "plugins/actix-web", version = "0.7.0", optional = true }
paperclip-core = { path = "core", version = "0.7.0" }
paperclip-macros = { path = "macros", version = "0.6.3", optional = true }
paperclip-codegen = { path = "codegen", version = "0.1.0", optional = true }

env_logger = { version = "0.8", optional = true }
git2 = { version = "0.15", optional = true }
@@ -40,7 +41,8 @@ url_dep = { version = ">=1.7,<3", package = "url" }
thiserror = "1.0"
anyhow = "1.0"
once_cell = "1.4"
openapiv3 = { version = "1.0.3", optional = true }
indexmap = { version = "2.0", features = ["serde"], optional = true }
openapiv3 = { version = "2.0.0", optional = true }

[dev-dependencies]
actix-rt1 = { version = "1.0", package = "actix-rt" }
@@ -83,6 +85,8 @@ codegen = ["heck", "http", "log", "regex", "tinytemplate", "paperclip-core/codeg
v2 = ["paperclip-macros/v2", "paperclip-core/v2"]
# OpenAPI v2 to v3 support
v3 = ["openapiv3", "v2", "paperclip-core/v3", "paperclip-actix/v3"]
# Experimental V3 CodeGen
v3-poc = ["paperclip-codegen", "openapiv3"]


# Features for implementing traits for dependencies.
@@ -106,6 +110,8 @@ members = [
"core",
"macros",
"plugins/actix-web",
"codegen",
"testgen"
]

[[test]]
29 changes: 29 additions & 0 deletions codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "paperclip-codegen"
version = "0.1.0"
edition = "2018"
license = "MIT OR Apache-2.0"
keywords = [ "openapi", "openapiv3", "codegen" ]
description = "Experimental OpenAPI V3.0.3 Code Generator"
homepage = "https://github.com/paperclip-rs/paperclip"
repository = "https://github.com/paperclip-rs/paperclip"

[lib]

[[bin]]
name = "paperclip-cli"
path = "src/bin/main.rs"

[dependencies]
ramhorns = { version = "1.0", default-features = false, features = ["indexes"], optional = true }
ramhorns-derive = { version = "1.0", optional = true }
openapiv3 = { version = "2.0.0", optional = true }
heck = { version = "0.4", optional = true }
itertools = { version = "0.10", optional = true }
log = { version = "0.4", features = ["kv_unstable"] }


[features]
default = [ "poc" ]
ramhorns-feat = [ "ramhorns", "ramhorns-derive" ]
poc = [ "ramhorns-feat", "openapiv3", "heck", "itertools" ]
3 changes: 3 additions & 0 deletions codegen/src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
9 changes: 9 additions & 0 deletions codegen/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mod v3;

pub mod v3_03 {
pub use super::v3::{OpenApiV3, PackageInfo};
}

#[cfg_attr(feature = "ramhorns-feat", macro_use)]
#[cfg(feature = "ramhorns-feat")]
extern crate log;
Loading

0 comments on commit 6a3854c

Please sign in to comment.