#![allow(clippy::exhaustive_structs, reason = "Handlers have auto-generated OpenAPI documentation")]
#![allow(clippy::unused_async, reason = "Handler functions need to be async")]
#[cfg(test)]
#[path = "tests/handlers.rs"]
mod tests;
use super::responses::HealthVersionResponse;
use axum::Json;
#[cfg_attr(feature = "utoipa", utoipa::path(
get,
path = "/api/ping",
tag = "health",
responses(
(status = 200, description = "Availability check"),
),
))]
pub async fn get_ping() {}
#[cfg_attr(feature = "utoipa", utoipa::path(
get,
path = "/api/version",
tag = "health",
responses(
(status = 200, description = "Current version retrieved successfully"),
),
))]
pub async fn get_version() -> Json<HealthVersionResponse> {
Json(HealthVersionResponse {
version: env!("CARGO_PKG_VERSION").to_owned(),
})
}