hive-c0re: annotate the 3 SSE/stream dashboard routes with utoipa
This commit is contained in:
parent
dbff9f0987
commit
d10eebd455
3 changed files with 50 additions and 26 deletions
|
|
@ -207,6 +207,18 @@ struct BuildLogFrame {
|
|||
/// always carries the full accumulated log so far (cursors start at 0);
|
||||
/// subsequent frames carry only new bytes. `done: true` on the final
|
||||
/// frame signals the browser to close the `EventSource`.
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/api/build-logs/id/{id}/stream",
|
||||
params(("id" = i64, Path, description = "build log row id")),
|
||||
responses(
|
||||
(status = 200, description = "server-sent event stream; each event's \
|
||||
`data` is a JSON-serialised `BuildLogFrame` \
|
||||
(stdout_append/stderr_append/status/done)",
|
||||
body = String, content_type = "text/event-stream"),
|
||||
),
|
||||
tag = "build_logs"
|
||||
)]
|
||||
pub(super) async fn get_build_log_stream(
|
||||
State(state): State<AppState>,
|
||||
AxumPath(id): AxumPath<i64>,
|
||||
|
|
|
|||
Loading…
Reference in a new issue