Skip to content

Commit

Permalink
Fix leaking actix type not behind actix feature (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlebran authored Sep 25, 2024
2 parents c21d165 + a622464 commit 48aeeac
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 3 additions & 4 deletions apistos-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -29,18 +29,17 @@ 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 }
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
Expand Down
6 changes: 5 additions & 1 deletion apistos-core/src/api_component.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -176,6 +179,7 @@ where
}
}

#[cfg(feature = "actix")]
impl<T, E> ApiComponent for Either<T, E>
where
T: ApiComponent,
Expand Down
4 changes: 2 additions & 2 deletions apistos-gen-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion apistos-rapidoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion apistos-redoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion apistos-scalar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion apistos-shuttle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion apistos-swagger-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
26 changes: 13 additions & 13 deletions apistos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 48aeeac

Please sign in to comment.