diff --git a/Cargo.lock b/Cargo.lock index 5dd58db..099410e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2477,6 +2477,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3ab4b7269d14d93626b0bfedf212f1b0995cb7d13d35daba21d579511e7fae8" dependencies = [ + "axum", "serde", "serde_json", "utoipa", diff --git a/sbv2_api/Cargo.toml b/sbv2_api/Cargo.toml index 989302e..c115f10 100644 --- a/sbv2_api/Cargo.toml +++ b/sbv2_api/Cargo.toml @@ -13,7 +13,7 @@ sbv2_core = { version = "0.2.0-alpha", path = "../sbv2_core" } serde = { version = "1.0.210", features = ["derive"] } tokio = { version = "1.40.0", features = ["full"] } utoipa = { version = "4.2.3", features = ["axum_extras"] } -utoipa-scalar = "0.1.0" +utoipa-scalar = { version = "0.1.0", features = ["axum"] } [features] coreml = ["sbv2_core/coreml"] diff --git a/sbv2_api/src/main.rs b/sbv2_api/src/main.rs index 3fb9f59..93dd557 100644 --- a/sbv2_api/src/main.rs +++ b/sbv2_api/src/main.rs @@ -19,7 +19,7 @@ use crate::error::AppResult; #[derive(OpenApi)] #[openapi( - paths(openapi, models, synthesize), + paths(models, synthesize), components(schemas(SynthesizeRequest)) )] struct ApiDoc; @@ -164,7 +164,7 @@ async fn main() -> anyhow::Result<()> { .route("/synthesize", post(synthesize)) .route("/models", get(models)) .with_state(AppState::new().await?) - .merge(Scalar::with_url("/docs", ApiDoc::openapi())) + .merge(Scalar::with_url("/docs", ApiDoc::openapi())); let addr = env::var("ADDR").unwrap_or("0.0.0.0:3000".to_string()); let listener = tokio::net::TcpListener::bind(&addr).await?; log::info!("Listening on {addr}");