Skip to content

Commit b92183c

Browse files
committed
utoipa: Add annotations to /me/email_notifications endpoints
1 parent a3015f7 commit b92183c

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

src/controllers/user/me.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,18 @@ pub async fn confirm_user_email(state: AppState, Path(token): Path<String>) -> A
133133
ok_true()
134134
}
135135

136-
/// Handles `PUT /me/email_notifications` route
136+
/// Update email notification settings for the authenticated user.
137+
///
138+
/// This endpoint was implemented for an experimental feature that was never
139+
/// fully implemented. It is now deprecated and will be removed in the future.
140+
#[utoipa::path(
141+
put,
142+
path = "/api/v1/me/email_notifications",
143+
operation_id = "update_email_notifications",
144+
tag = "users",
145+
responses((status = 200, description = "Successful Response")),
146+
)]
147+
#[deprecated]
137148
pub async fn update_email_notifications(app: AppState, req: BytesRequest) -> AppResult<Response> {
138149
use diesel::pg::upsert::excluded;
139150

src/router.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,10 @@ pub fn build_axum_router(state: AppState) -> Router<()> {
5555
.routes(routes!(crate_owner_invitation::list))
5656
.routes(routes!(crate_owner_invitation::handle_invite))
5757
.routes(routes!(crate_owner_invitation::handle_invite_with_token))
58+
.routes(routes!(user::me::update_email_notifications))
5859
.split_for_parts();
5960

6061
let mut router = router
61-
.route(
62-
"/api/v1/me/email_notifications",
63-
put(user::me::update_email_notifications),
64-
)
6562
.route("/api/v1/summary", get(summary::summary))
6663
.route(
6764
"/api/v1/confirm/:email_token",

src/snapshots/crates_io__openapi__tests__openapi_snapshot.snap

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,22 @@ snapshot_kind: text
496496
]
497497
}
498498
},
499+
"/api/v1/me/email_notifications": {
500+
"put": {
501+
"deprecated": true,
502+
"description": "This endpoint was implemented for an experimental feature that was never\nfully implemented. It is now deprecated and will be removed in the future.",
503+
"operationId": "update_email_notifications",
504+
"responses": {
505+
"200": {
506+
"description": "Successful Response"
507+
}
508+
},
509+
"summary": "Update email notification settings for the authenticated user.",
510+
"tags": [
511+
"users"
512+
]
513+
}
514+
},
499515
"/api/v1/me/tokens": {
500516
"get": {
501517
"operationId": "list_api_tokens",

0 commit comments

Comments
 (0)