summaryrefslogtreecommitdiff
path: root/src/health.rs
diff options
context:
space:
mode:
authorDawid Rycerz <dawid@rycerz.xyz>2025-07-16 23:37:24 +0300
committerDawid Rycerz <dawid@rycerz.xyz>2025-07-16 23:37:24 +0300
commitfa00c5863394c91a7b34680849908b1059e368f2 (patch)
treee357a7f322c644ce9487c4658e4a07ddb0e44611 /src/health.rs
parentaf4680ee0577b28d0563ddc3d2677e8c96f4f5eb (diff)
feat: add openapi docs generation
Diffstat (limited to 'src/health.rs')
-rw-r--r--src/health.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/health.rs b/src/health.rs
index ddf949a..c3ae80a 100644
--- a/src/health.rs
+++ b/src/health.rs
@@ -1,6 +1,19 @@
use axum::{Json, response::IntoResponse};
use serde_json::json;
+#[utoipa::path(
+ get,
+ path = "/health",
+ responses(
+ (status = 200, description = "Health check", body = inline(HealthResponse))
+ ),
+ tag = "health"
+)]
pub async fn health_handler() -> impl IntoResponse {
Json(json!({"status": "ok"}))
}
+
+#[derive(utoipa::ToSchema, serde::Serialize)]
+pub struct HealthResponse {
+ pub status: String,
+}