-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use `curl` to download Swagger UI by default and allow using `reqwest` optionally with `reqwest` feature flag. Reqwest will be automatically enabled on Windows targets. Change the re-build parameters as follows. * For file protocol the re-build should happen when the upstream file changes * For http protocol the re-build should happen when the environment variable holding the downloadd URL will change.
- Loading branch information
Showing
3 changed files
with
116 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,15 +12,20 @@ authors = ["Juha Kukkonen <[email protected]>"] | |
rust-version.workspace = true | ||
|
||
[features] | ||
default = ["url"] | ||
debug = [] | ||
debug-embed = ["rust-embed/debug-embed"] | ||
reqwest = ["dep:reqwest"] | ||
url = ["dep:url"] | ||
|
||
[dependencies] | ||
rust-embed = { version = "8" } | ||
mime_guess = { version = "2.0" } | ||
actix-web = { version = "4", optional = true, default-features = false } | ||
rocket = { version = "0.5", features = ["json"], optional = true } | ||
axum = { version = "0.7", default-features = false, features = ["json"], optional = true } | ||
axum = { version = "0.7", default-features = false, features = [ | ||
"json", | ||
], optional = true } | ||
utoipa = { version = "4", path = "../utoipa" } | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde_json = { version = "1.0" } | ||
|
@@ -35,4 +40,18 @@ rustdoc-args = ["--cfg", "doc_cfg"] | |
[build-dependencies] | ||
zip = { version = "1", default-features = false, features = ["deflate"] } | ||
regex = "1.7" | ||
reqwest = { version = "0.12", features = ["blocking", "rustls-tls"], default-features = false } | ||
|
||
# enabled optionally to allow rust only build with expense of bigger dependency tree and platform | ||
# independant build. By default `curl` system package is tried for downloading the Swagger UI. | ||
reqwest = { version = "0.12", features = [ | ||
"blocking", | ||
"rustls-tls", | ||
], default-features = false, optional = true } | ||
url = { version = "2.5", optional = true } | ||
|
||
# Windows is forced to use reqwest to download the Swagger UI. | ||
[target.'cfg(windows)'.build-dependencies] | ||
reqwest = { version = "0.12", features = [ | ||
"blocking", | ||
"rustls-tls", | ||
], default-features = false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters