use axum::{
    http::{Response, header},
    response::IntoResponse,
};

pub async fn openapi_yaml() -> impl IntoResponse {
    let spec = include_str!("../../openapi.yaml");
    let version = env!("CARGO_PKG_VERSION");
    let spec_with_version = spec.replace("version: 0.0.0", &format!("version: {}", version));

    Response::builder().header(header::CONTENT_TYPE, "text/yaml").body(spec_with_version).unwrap()
}
