From d1b3870d0224e2cb1b06fc134212db8c0af5d06d Mon Sep 17 00:00:00 2001 From: Romain Lebran Date: Tue, 24 Sep 2024 08:34:29 +0200 Subject: [PATCH 1/2] Fix leaking actix type not behind actix feature --- apistos-core/Cargo.toml | 5 ++--- apistos-core/src/api_component.rs | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apistos-core/Cargo.toml b/apistos-core/Cargo.toml index 5605a377..9a2c37e5 100644 --- a/apistos-core/Cargo.toml +++ b/apistos-core/Cargo.toml @@ -14,7 +14,7 @@ rust-version.workspace = true license.workspace = true [dependencies] -pin-project = { workspace = true } +pin-project = { workspace = true, optional = true } schemars = { workspace = true } actix-web = { workspace = true, optional = true } @@ -33,14 +33,13 @@ apistos-models = { path = "../apistos-models", version = "0.4.0", features = ["d [dev-dependencies] assert-json-diff = { workspace = true } -serde = { workspace = true } serde_json = { workspace = true } [lints] workspace = true [features] -actix = ["dep:actix-web"] +actix = ["dep:actix-web", "dep:pin-project"] actix-web-grants = ["dep:actix-web-grants"] # query related features diff --git a/apistos-core/src/api_component.rs b/apistos-core/src/api_component.rs index ac200570..2199f4e4 100644 --- a/apistos-core/src/api_component.rs +++ b/apistos-core/src/api_component.rs @@ -1,12 +1,15 @@ use crate::ApiErrorComponent; #[cfg(feature = "actix")] use crate::{PathItemDefinition, ResponseWrapper}; +#[cfg(feature = "actix")] use actix_web::Either; use apistos_models::paths::{MediaType, Parameter, RequestBody, Response, Responses}; use apistos_models::reference_or::ReferenceOr; use apistos_models::security::SecurityScheme; use apistos_models::Schema; -use schemars::schema::{ArrayValidation, InstanceType, SchemaObject, SingleOrVec, SubschemaValidation}; +#[cfg(feature = "actix")] +use schemars::schema::SubschemaValidation; +use schemars::schema::{ArrayValidation, InstanceType, SchemaObject, SingleOrVec}; use std::collections::BTreeMap; #[cfg(feature = "actix")] use std::future::Future; @@ -176,6 +179,7 @@ where } } +#[cfg(feature = "actix")] impl ApiComponent for Either where T: ApiComponent, From a622464cb369bc6a26166641dcc45f1db80c3e5f Mon Sep 17 00:00:00 2001 From: Romain Lebran Date: Wed, 25 Sep 2024 08:25:25 +0200 Subject: [PATCH 2/2] Prepare v0.4.1 --- Cargo.toml | 2 +- apistos-core/Cargo.toml | 2 +- apistos-gen-test/Cargo.toml | 4 ++-- apistos-rapidoc/Cargo.toml | 2 +- apistos-redoc/Cargo.toml | 2 +- apistos-scalar/Cargo.toml | 2 +- apistos-shuttle/Cargo.toml | 2 +- apistos-swagger-ui/Cargo.toml | 2 +- apistos/Cargo.toml | 26 +++++++++++++------------- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8566b283..cf858763 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ documentation = "https://docs.rs/apistos/" license = "MIT OR Apache-2.0" rust-version = "1.75" publish = true -version = "0.4.0" +version = "0.4.1" [workspace.dependencies] actix-service = "2" diff --git a/apistos-core/Cargo.toml b/apistos-core/Cargo.toml index 9a2c37e5..7a689351 100644 --- a/apistos-core/Cargo.toml +++ b/apistos-core/Cargo.toml @@ -29,7 +29,7 @@ serde_qs = { workspace = true, features = ["actix4"], optional = true } uuid = { workspace = true, optional = true } url = { workspace = true, optional = true } -apistos-models = { path = "../apistos-models", version = "0.4.0", features = ["deserialize"] } +apistos-models = { path = "../apistos-models", version = "0.4.1", features = ["deserialize"] } [dev-dependencies] assert-json-diff = { workspace = true } diff --git a/apistos-gen-test/Cargo.toml b/apistos-gen-test/Cargo.toml index a513d6ca..e5aabc2b 100644 --- a/apistos-gen-test/Cargo.toml +++ b/apistos-gen-test/Cargo.toml @@ -21,8 +21,8 @@ assert-json-diff = { workspace = true } chrono = { workspace = true, features = ["serde"] } futures-core = { workspace = true } apistos = { path = "../apistos", features = ["multipart", "uuid"] } -apistos-core = { path = "../apistos-core", version = "0.4.0", features = ["actix-web-grants"] } -apistos-gen = { path = "../apistos-gen", version = "0.4.0" } +apistos-core = { path = "../apistos-core", version = "0.4.1", features = ["actix-web-grants"] } +apistos-gen = { path = "../apistos-gen", version = "0.4.1" } # we use the "preserve_order" feature from schemars here following https://github.com/netwo-io/apistos/pull/78 schemars = { workspace = true, features = ["preserve_order"] } serde = { workspace = true, features = ["derive"] } diff --git a/apistos-rapidoc/Cargo.toml b/apistos-rapidoc/Cargo.toml index 4c72667b..546f5d6e 100644 --- a/apistos-rapidoc/Cargo.toml +++ b/apistos-rapidoc/Cargo.toml @@ -14,7 +14,7 @@ rust-version.workspace = true license.workspace = true [dependencies] -apistos-plugins = { path = "../apistos-plugins", version = "0.4.0" } +apistos-plugins = { path = "../apistos-plugins", version = "0.4.1" } [lints] workspace = true diff --git a/apistos-redoc/Cargo.toml b/apistos-redoc/Cargo.toml index 35b78a7e..ce3ca27c 100644 --- a/apistos-redoc/Cargo.toml +++ b/apistos-redoc/Cargo.toml @@ -14,7 +14,7 @@ rust-version.workspace = true license.workspace = true [dependencies] -apistos-plugins = { path = "../apistos-plugins", version = "0.4.0" } +apistos-plugins = { path = "../apistos-plugins", version = "0.4.1" } [lints] workspace = true diff --git a/apistos-scalar/Cargo.toml b/apistos-scalar/Cargo.toml index 496e226c..75787c1e 100644 --- a/apistos-scalar/Cargo.toml +++ b/apistos-scalar/Cargo.toml @@ -14,7 +14,7 @@ rust-version.workspace = true license.workspace = true [dependencies] -apistos-plugins = { path = "../apistos-plugins", version = "0.4.0" } +apistos-plugins = { path = "../apistos-plugins", version = "0.4.1" } [lints] workspace = true diff --git a/apistos-shuttle/Cargo.toml b/apistos-shuttle/Cargo.toml index 5c1215f8..365b8871 100644 --- a/apistos-shuttle/Cargo.toml +++ b/apistos-shuttle/Cargo.toml @@ -18,7 +18,7 @@ actix-web = { workspace = true } num_cpus = { workspace = true } shuttle-runtime = { workspace = true } -apistos = { path = "../apistos", version = "0.4.0" } +apistos = { path = "../apistos", version = "0.4.1" } [lints] workspace = true diff --git a/apistos-swagger-ui/Cargo.toml b/apistos-swagger-ui/Cargo.toml index 01f15348..8474d87c 100644 --- a/apistos-swagger-ui/Cargo.toml +++ b/apistos-swagger-ui/Cargo.toml @@ -14,7 +14,7 @@ rust-version.workspace = true license.workspace = true [dependencies] -apistos-plugins = { path = "../apistos-plugins", version = "0.4.0" } +apistos-plugins = { path = "../apistos-plugins", version = "0.4.1" } [lints] workspace = true diff --git a/apistos/Cargo.toml b/apistos/Cargo.toml index 9654bc00..56e01407 100644 --- a/apistos/Cargo.toml +++ b/apistos/Cargo.toml @@ -26,25 +26,25 @@ schemars = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -apistos-core = { path = "../apistos-core", version = "0.4.0" } -apistos-gen = { path = "../apistos-gen", version = "0.4.0" } -apistos-models = { path = "../apistos-models", version = "0.4.0" } -apistos-plugins = { path = "../apistos-plugins", version = "0.4.0" } -apistos-rapidoc = { path = "../apistos-rapidoc", version = "0.4.0", optional = true } -apistos-redoc = { path = "../apistos-redoc", version = "0.4.0", optional = true } -apistos-scalar = { path = "../apistos-scalar", version = "0.4.0", optional = true } -apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "0.4.0", optional = true } +apistos-core = { path = "../apistos-core", version = "0.4.1" } +apistos-gen = { path = "../apistos-gen", version = "0.4.1" } +apistos-models = { path = "../apistos-models", version = "0.4.1" } +apistos-plugins = { path = "../apistos-plugins", version = "0.4.1" } +apistos-rapidoc = { path = "../apistos-rapidoc", version = "0.4.1", optional = true } +apistos-redoc = { path = "../apistos-redoc", version = "0.4.1", optional = true } +apistos-scalar = { path = "../apistos-scalar", version = "0.4.1", optional = true } +apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "0.4.1", optional = true } [dev-dependencies] actix-web-lab = { workspace = true } garde-actix-web = { workspace = true } -apistos-models = { path = "../apistos-models", version = "0.4.0", features = ["deserialize"] } -apistos-rapidoc = { path = "../apistos-rapidoc", version = "0.4.0" } -apistos-redoc = { path = "../apistos-redoc", version = "0.4.0" } -apistos-scalar = { path = "../apistos-scalar", version = "0.4.0" } -apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "0.4.0" } +apistos-models = { path = "../apistos-models", version = "0.4.1", features = ["deserialize"] } +apistos-rapidoc = { path = "../apistos-rapidoc", version = "0.4.1" } +apistos-redoc = { path = "../apistos-redoc", version = "0.4.1" } +apistos-scalar = { path = "../apistos-scalar", version = "0.4.1" } +apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "0.4.1" } [lints] workspace = true