Skip to content

Commit

Permalink
add route description
Browse files Browse the repository at this point in the history
  • Loading branch information
felix1251 committed Feb 15, 2024
1 parent c44f415 commit 26c531b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/routes/auth/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct SignInParams {
password: Option<String>,
}

/// User Sign In
#[utoipa::path(
post,
request_body = SignInParams,
Expand Down Expand Up @@ -96,6 +97,7 @@ pub struct SignUpParams {
pub password: Option<String>,
}

/// User Sign Up
#[utoipa::path(
post,
request_body = SignUpParams,
Expand Down Expand Up @@ -130,6 +132,7 @@ pub async fn sign_up(
return Ok(Json(token));
}

/// Refresh token
#[utoipa::path(
post,
tag = "Auth",
Expand Down Expand Up @@ -178,6 +181,7 @@ pub struct CurrentUser {
pub updated_at: DateTimeWithTimeZone,
}

/// Current user information
#[utoipa::path(
get,
tag = "Auth",
Expand Down
1 change: 1 addition & 0 deletions src/routes/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub struct HomeSchema {
message: &'static str,
}

/// Health check
#[utoipa::path(
get,
tag = "Home",
Expand Down
3 changes: 3 additions & 0 deletions src/swagger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ use utoipa_swagger_ui::SwaggerUi;
auth::handlers::CurrentUser,
)
),
tags(
(name = "Auth", description = "Authentication endpoints.")
),
modifiers(&SecurityAddon)
)]
struct ApiDoc;
Expand Down

0 comments on commit 26c531b

Please sign in to comment.