obscura-server 0.2.6

A server for relaying secure messages using the Signal Protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use axum::{
    http::{header, Response},
    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()
}