Skip to content

Commit

Permalink
bugfix: redirect /swagger-ui to /swagger-ui/ and fix bulk_create docs
Browse files Browse the repository at this point in the history
  • Loading branch information
densumesh authored and skeptrunedev committed Mar 20, 2024
1 parent 1d36391 commit 963fe68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/handlers/chunk_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ pub async fn create_chunk(
path = "/chunk/bulk",
context_path = "/api",
tag = "chunk",
request_body(content = CreateChunkData, description = "JSON request payload to create a new chunk (chunk)", content_type = "application/json"),
request_body(content = Vec<CreateChunkData>, description = "JSON request payload to create a new chunk (chunk)", content_type = "application/json"),
responses(
(status = 200, description = "JSON response payload containing the created chunk", body = ReturnQueuedChunk),
(status = 400, description = "Service error relating to to creating a chunk, likely due to conflicting tracking_id", body = ErrorResponseBody),
Expand Down
4 changes: 4 additions & 0 deletions server/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#[macro_use]
extern crate diesel;
use actix_web::HttpResponse;
use diesel_async::pooled_connection::AsyncDieselConnectionManager;
use diesel_async::pooled_connection::ManagerConfig;
use openssl::ssl::SslVerifyMode;
Expand Down Expand Up @@ -440,6 +441,9 @@ pub async fn main() -> std::io::Result<()> {
SwaggerUi::new("/swagger-ui/{_:.*}")
.url("/api-docs/openapi.json", ApiDoc::openapi())
)
.service(
web::redirect("/swagger-ui", "/swagger-ui/")
)
// everything under '/api/' route
.service(
web::scope("/api")
Expand Down

0 comments on commit 963fe68

Please sign in to comment.