-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add vendored Swagger UI for utoipa. This can be enabled with `vendored` crate feature flag of `utoipa-swagger-ui` crate.
- Loading branch information
Showing
17 changed files
with
238 additions
and
81 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
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
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# | ||
# Update Swagger UI version | ||
|
||
set -eu -o pipefail | ||
|
||
version="${1:-""}" | ||
if [ -z "$version" ]; then | ||
echo "Missing 'version' argument from commmand, run as $0 <version>" >&2 && exit 1 | ||
fi | ||
zip_name="v$version.zip" | ||
|
||
curl -sSL -o "$zip_name" "https://github.com/swagger-api/swagger-ui/archive/refs/tags/v$version.zip" | ||
|
||
echo "Update vendored Swagger UI" | ||
mv "$zip_name" ./utoipa-swagger-ui-vendored/res/ | ||
sed -i "s|version: \`.*\`|version: \`$version\`|" ./utoipa-swagger-ui-vendored/README.md | ||
sed -i "s|version: \`.*\`|version: \`$version\`|" ./utoipa-swagger-ui-vendored/src/lib.rs | ||
|
||
echo "Update utoipa-swagger-ui Swagger UI version" | ||
sed -i "s|tags/v.*>|tags/v$version.zip>|" ./utoipa-swagger-ui/README.md | ||
sed -i "s|tags/v.*>|tags/v$version.zip>|" ./utoipa-swagger-ui/src/lib.rs | ||
sed -i "s|tags/v.*\.zip|tags/v$version.zip|" ./utoipa-swagger-ui/build.rs |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "utoipa-swagger-ui-vendored" | ||
description = "Vendored Swagger UI for utoipa" | ||
license = "MIT OR Apache-2.0" | ||
readme = "README.md" | ||
version = "0.1.0" | ||
edition = "2021" | ||
keywords = ["swagger-ui", "vendored", "openapi", "documentation"] | ||
repository = "https://github.com/juhaku/utoipa" | ||
categories = ["web-programming"] | ||
authors = ["Juha Kukkonen <juha7kukkonen@gmail.com>"] | ||
rust-version.workspace = true | ||
|
||
exclude = ["res"] | ||
|
||
[dependencies] |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
../LICENSE-APACHE |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
../LICENSE-MIT |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# utoipa-swagger-ui-vendored | ||
|
||
[![Utoipa build](https://github.com/juhaku/utoipa/actions/workflows/build.yaml/badge.svg)](https://github.com/juhaku/utoipa/actions/workflows/build.yaml) | ||
[![crates.io](https://img.shields.io/crates/v/utoipa-swagger-ui-vendored.svg?label=crates.io&color=orange&logo=rust)](https://crates.io/crates/utoipa-swagger-ui-vendored) | ||
[![docs.rs](https://img.shields.io/static/v1?label=docs.rs&message=utoipa-swagger-ui-vendored&color=blue&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K)](https://docs.rs/utoipa-swagger-ui-vendored/latest/utoipa_swagger_ui-vendored/) | ||
![rustc](https://img.shields.io/static/v1?label=rustc&message=1.75&color=orange&logo=rust) | ||
|
||
This crate holds the [Swagger UI](https://github.com/swagger-api/swagger-ui) zip archive re-packaged as | ||
Rust crate. The crate serves as a build dependency for `utoipa-swagger-ui` and is used to serve the | ||
Swagger UI when `vendored` crate feature is enabled for `utoipa-swagger-ui` crate. | ||
|
||
Vendored Swagger UI provides the means to serve Swagger UI in sandboxed environments where network access or | ||
even other means to provide Swagger UI is not possible. | ||
|
||
**Swagger UI version: `5.17.12`** | ||
|
||
## License | ||
|
||
Licensed under either of [Apache 2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT) license at your option. | ||
|
||
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate | ||
by you, shall be dual licensed, without any additional terms or conditions. |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//! This crate holds the [Swagger UI](https://github.com/swagger-api/swagger-ui) zip archive re-packaged as | ||
//! Rust crate. The crate serves as a build dependency for `utoipa-swagger-ui` and is used to serve the | ||
//! Swagger UI when `vendored` crate feature is enabled for `utoipa-swagger-ui` crate. | ||
//! | ||
//! Vendored Swagger UI provides the means to serve Swagger UI in sandboxed environments where network access or | ||
//! even other means to provide Swagger UI is not possible. | ||
//! | ||
//! **Swagger UI version: `5.17.12`** | ||
//! | ||
//! ## License | ||
//! | ||
//! Licensed under either of [Apache 2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT) license at your option. | ||
//! | ||
//! Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate | ||
//! by you, shall be dual licensed, without any additional terms or conditions. | ||
/// Swagger UI zip bytes | ||
#[doc(hidden)] | ||
pub const SWAGGER_UI_VENDORED: &[u8] = std::include_bytes!("../res/v5.17.12.zip"); |
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
Oops, something went wrong.