From 493fe44b23d3f4c3f271278b5137f4968cba036c Mon Sep 17 00:00:00 2001 From: Tolmachev Igor Date: Thu, 25 Sep 2025 14:01:41 +0300 Subject: Fix grammar --- src/routers/queue.rs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/routers/queue.rs') diff --git a/src/routers/queue.rs b/src/routers/queue.rs index 1e93b2a..df846fb 100644 --- a/src/routers/queue.rs +++ b/src/routers/queue.rs @@ -32,12 +32,14 @@ async fn get_owned_queue( } #[derive(Deserialize, ToSchema)] +#[schema(description = "Body of the create queue request")] struct CreateQueueRequest { #[schema(examples("John's queue", "Очередь Ивана"))] name: String, } #[derive(Deserialize, ToSchema)] +#[schema(description = "Body of the change queue name request")] struct ChangeQueueNameRequest { #[schema(examples(1))] id: i64, @@ -46,7 +48,8 @@ struct ChangeQueueNameRequest { } #[derive(Deserialize, ToSchema)] -struct ChangeQueueOwnerRequest { +#[schema(description = "Body of the change queue ownership request")] +struct ChangeQueueOwnershipRequest { #[schema(examples(1))] id: i64, #[schema(examples(1))] @@ -54,6 +57,7 @@ struct ChangeQueueOwnerRequest { } #[derive(Deserialize, ToSchema)] +#[schema(description = "Body of the delete queue request")] struct DeleteQueueRequest { #[schema(examples(1))] id: i64, @@ -64,7 +68,7 @@ struct DeleteQueueRequest { path = "/owned", tag = QUEUE, summary = "Get owned", - description = "Get your own queues", + description = "Get your queues", responses( ( status = 200, body = SuccessResponse>, @@ -96,7 +100,7 @@ async fn owned(State(state): State, Auth(user): Auth) -> ApiResult, - description = "Success response with created queue" + description = "Success response with the created queue" ), GlobalResponses ), @@ -129,7 +133,7 @@ async fn create( responses( ( status = 200, body = SuccessResponse, - description = "Success response with changed queue data" + description = "Success response with the changed queue data" ), GlobalResponses ), @@ -155,12 +159,12 @@ async fn change_name( path = "/change/owner", tag = QUEUE, summary = "Change owner", - description = "Transfer ownership of the queue", - request_body = ChangeQueueOwnerRequest, + description = "Reassign queue ownership", + request_body = ChangeQueueOwnershipRequest, responses( ( status = 200, body = SuccessResponse, - description = "Success response with changed queue data" + description = "Success response with the changed queue data" ), GlobalResponses ), @@ -169,7 +173,7 @@ async fn change_name( async fn change_owner( State(state): State, Auth(user): Auth, - ApiJson(req): ApiJson, + ApiJson(req): ApiJson, ) -> ApiResult { if !user_exists(req.new_owner_id, &state.db).await? { return Err(ClientError::UserNotFound { @@ -193,12 +197,12 @@ async fn change_owner( path = "/delete", tag = QUEUE, summary = "Delete", - description = "Delete queue", + description = "Delete the queue", request_body = DeleteQueueRequest, responses( ( status = 200, body = SuccessResponse, - description = "Success response with deleted queue data" + description = "Success response with the deleted queue data" ), GlobalResponses ), -- cgit v1.2.3