Watch
0
0
Fork
You've already forked hyperhive
0

hive-c0re: drop redundant METHOD/path prefixes from OpenAPI summaries

Swagger UI's endpoint-list row already shows the HTTP method badge +
path for every row, so restating `METHOD /path` at the start of a
handler's own summary is pure duplication. Strips that self-referential
prefix from every summary that has it and re-capitalizes what follows
as a standalone sentence.

Left two false positives untouched: misc_api.rs's operator-inbox
summary cross-references a *different* sibling endpoint
(mark-all-read) for context, and topology.rs's SetParentForm struct
doc happens to mention its endpoint's path but isn't a handler summary
line. Both are legitimate, not redundant.
This commit is contained in:
iris 2026-08-02 21:03:33 +02:00 • committed by mara
commit ec30277a90

View file

@ -16,7 +16,7 @@ use super::{AppState, error_response};
use crate::actions;
use crate::coordinator::Coordinator;
/// `POST /api/approve/{id}` — approve a pending approval row.
/// Approve a pending approval row.
#[utoipa::path(
post,
path = "/api/approve/{id}",
@ -47,7 +47,7 @@ pub(super) struct DenyForm {
note: Option<String>,
}
/// `POST /api/deny/{id}` — deny a pending approval row, with an optional
/// Deny a pending approval row, with an optional
/// note (form field `note`).
#[utoipa::path(
post,