Skip to content

Commit

Permalink
chore(examples): utoipa v4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Oct 11, 2023
1 parent 7252cd3 commit e2bf4a5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ prometheus = "0.13"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

pin-project-lite = "0.2"

[workspace.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
4 changes: 2 additions & 2 deletions examples/routing/openapi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }

utoipa = "3.4.0"
utoipa-swagger-ui = "3.1.4"
utoipa = "4.0"
utoipa-swagger-ui = "4.0"
11 changes: 10 additions & 1 deletion examples/routing/openapi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,16 @@ async fn main() -> Result<(), Error> {
"/api-doc/openapi.json",
openapi_json.with(State::new(apidoc)),
)
.get("/swagger-ui/*", swagger_ui.with(State::new(config)));
.get("/swagger-ui/*", swagger_ui.with(State::new(config)))
.get("/", |_| async move {
Ok(Response::html(
r#"
<a href="/swagger-ui/">Swagger UI</a>
<br />
<a href="/api-doc/openapi.json">OpenAPI JSON</a>
"#,
))
});
let tree = Arc::new(Tree::from(app));

loop {
Expand Down
1 change: 0 additions & 1 deletion viz-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ tokio = { workspace = true, optional = true }
tokio-tungstenite = { workspace = true, optional = true }
tokio-stream = { workspace = true, optional = true }
tokio-util = { workspace = true, optional = true }
pin-project-lite.workspace = true

[dev-dependencies]
viz = { workspace = true, features = ["session"] }
Expand Down

0 comments on commit e2bf4a5

Please sign in to comment.