From fa00c5863394c91a7b34680849908b1059e368f2 Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Wed, 16 Jul 2025 23:37:24 +0300 Subject: feat: add openapi docs generation --- src/health.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/health.rs') 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, +} -- cgit v1.2.3