Skip to content

Commit 48aeeac

Browse files
authored
Fix leaking actix type not behind actix feature (#134)
2 parents c21d165 + a622464 commit 48aeeac

File tree

10 files changed

+29
-26
lines changed

10 files changed

+29
-26
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ documentation = "https://docs.rs/apistos/"
2222
license = "MIT OR Apache-2.0"
2323
rust-version = "1.75"
2424
publish = true
25-
version = "0.4.0"
25+
version = "0.4.1"
2626

2727
[workspace.dependencies]
2828
actix-service = "2"

apistos-core/Cargo.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rust-version.workspace = true
1414
license.workspace = true
1515

1616
[dependencies]
17-
pin-project = { workspace = true }
17+
pin-project = { workspace = true, optional = true }
1818
schemars = { workspace = true }
1919

2020
actix-web = { workspace = true, optional = true }
@@ -29,18 +29,17 @@ serde_qs = { workspace = true, features = ["actix4"], optional = true }
2929
uuid = { workspace = true, optional = true }
3030
url = { workspace = true, optional = true }
3131

32-
apistos-models = { path = "../apistos-models", version = "0.4.0", features = ["deserialize"] }
32+
apistos-models = { path = "../apistos-models", version = "0.4.1", features = ["deserialize"] }
3333

3434
[dev-dependencies]
3535
assert-json-diff = { workspace = true }
36-
serde = { workspace = true }
3736
serde_json = { workspace = true }
3837

3938
[lints]
4039
workspace = true
4140

4241
[features]
43-
actix = ["dep:actix-web"]
42+
actix = ["dep:actix-web", "dep:pin-project"]
4443
actix-web-grants = ["dep:actix-web-grants"]
4544

4645
# query related features

apistos-core/src/api_component.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
use crate::ApiErrorComponent;
22
#[cfg(feature = "actix")]
33
use crate::{PathItemDefinition, ResponseWrapper};
4+
#[cfg(feature = "actix")]
45
use actix_web::Either;
56
use apistos_models::paths::{MediaType, Parameter, RequestBody, Response, Responses};
67
use apistos_models::reference_or::ReferenceOr;
78
use apistos_models::security::SecurityScheme;
89
use apistos_models::Schema;
9-
use schemars::schema::{ArrayValidation, InstanceType, SchemaObject, SingleOrVec, SubschemaValidation};
10+
#[cfg(feature = "actix")]
11+
use schemars::schema::SubschemaValidation;
12+
use schemars::schema::{ArrayValidation, InstanceType, SchemaObject, SingleOrVec};
1013
use std::collections::BTreeMap;
1114
#[cfg(feature = "actix")]
1215
use std::future::Future;
@@ -176,6 +179,7 @@ where
176179
}
177180
}
178181

182+
#[cfg(feature = "actix")]
179183
impl<T, E> ApiComponent for Either<T, E>
180184
where
181185
T: ApiComponent,

apistos-gen-test/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ assert-json-diff = { workspace = true }
2121
chrono = { workspace = true, features = ["serde"] }
2222
futures-core = { workspace = true }
2323
apistos = { path = "../apistos", features = ["multipart", "uuid"] }
24-
apistos-core = { path = "../apistos-core", version = "0.4.0", features = ["actix-web-grants"] }
25-
apistos-gen = { path = "../apistos-gen", version = "0.4.0" }
24+
apistos-core = { path = "../apistos-core", version = "0.4.1", features = ["actix-web-grants"] }
25+
apistos-gen = { path = "../apistos-gen", version = "0.4.1" }
2626
# we use the "preserve_order" feature from schemars here following https://github.com/netwo-io/apistos/pull/78
2727
schemars = { workspace = true, features = ["preserve_order"] }
2828
serde = { workspace = true, features = ["derive"] }

apistos-rapidoc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rust-version.workspace = true
1414
license.workspace = true
1515

1616
[dependencies]
17-
apistos-plugins = { path = "../apistos-plugins", version = "0.4.0" }
17+
apistos-plugins = { path = "../apistos-plugins", version = "0.4.1" }
1818

1919
[lints]
2020
workspace = true

apistos-redoc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rust-version.workspace = true
1414
license.workspace = true
1515

1616
[dependencies]
17-
apistos-plugins = { path = "../apistos-plugins", version = "0.4.0" }
17+
apistos-plugins = { path = "../apistos-plugins", version = "0.4.1" }
1818

1919
[lints]
2020
workspace = true

apistos-scalar/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rust-version.workspace = true
1414
license.workspace = true
1515

1616
[dependencies]
17-
apistos-plugins = { path = "../apistos-plugins", version = "0.4.0" }
17+
apistos-plugins = { path = "../apistos-plugins", version = "0.4.1" }
1818

1919
[lints]
2020
workspace = true

apistos-shuttle/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ actix-web = { workspace = true }
1818
num_cpus = { workspace = true }
1919
shuttle-runtime = { workspace = true }
2020

21-
apistos = { path = "../apistos", version = "0.4.0" }
21+
apistos = { path = "../apistos", version = "0.4.1" }
2222

2323
[lints]
2424
workspace = true

apistos-swagger-ui/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rust-version.workspace = true
1414
license.workspace = true
1515

1616
[dependencies]
17-
apistos-plugins = { path = "../apistos-plugins", version = "0.4.0" }
17+
apistos-plugins = { path = "../apistos-plugins", version = "0.4.1" }
1818

1919
[lints]
2020
workspace = true

apistos/Cargo.toml

+13-13
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ schemars = { workspace = true }
2626
serde = { workspace = true }
2727
serde_json = { workspace = true }
2828

29-
apistos-core = { path = "../apistos-core", version = "0.4.0" }
30-
apistos-gen = { path = "../apistos-gen", version = "0.4.0" }
31-
apistos-models = { path = "../apistos-models", version = "0.4.0" }
32-
apistos-plugins = { path = "../apistos-plugins", version = "0.4.0" }
33-
apistos-rapidoc = { path = "../apistos-rapidoc", version = "0.4.0", optional = true }
34-
apistos-redoc = { path = "../apistos-redoc", version = "0.4.0", optional = true }
35-
apistos-scalar = { path = "../apistos-scalar", version = "0.4.0", optional = true }
36-
apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "0.4.0", optional = true }
29+
apistos-core = { path = "../apistos-core", version = "0.4.1" }
30+
apistos-gen = { path = "../apistos-gen", version = "0.4.1" }
31+
apistos-models = { path = "../apistos-models", version = "0.4.1" }
32+
apistos-plugins = { path = "../apistos-plugins", version = "0.4.1" }
33+
apistos-rapidoc = { path = "../apistos-rapidoc", version = "0.4.1", optional = true }
34+
apistos-redoc = { path = "../apistos-redoc", version = "0.4.1", optional = true }
35+
apistos-scalar = { path = "../apistos-scalar", version = "0.4.1", optional = true }
36+
apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "0.4.1", optional = true }
3737

3838

3939
[dev-dependencies]
4040
actix-web-lab = { workspace = true }
4141
garde-actix-web = { workspace = true }
4242

43-
apistos-models = { path = "../apistos-models", version = "0.4.0", features = ["deserialize"] }
44-
apistos-rapidoc = { path = "../apistos-rapidoc", version = "0.4.0" }
45-
apistos-redoc = { path = "../apistos-redoc", version = "0.4.0" }
46-
apistos-scalar = { path = "../apistos-scalar", version = "0.4.0" }
47-
apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "0.4.0" }
43+
apistos-models = { path = "../apistos-models", version = "0.4.1", features = ["deserialize"] }
44+
apistos-rapidoc = { path = "../apistos-rapidoc", version = "0.4.1" }
45+
apistos-redoc = { path = "../apistos-redoc", version = "0.4.1" }
46+
apistos-scalar = { path = "../apistos-scalar", version = "0.4.1" }
47+
apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "0.4.1" }
4848

4949
[lints]
5050
workspace = true

0 commit comments

Comments
 (0)