brk_server 0.3.0-beta.8

A server with an API for anything from BRK
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use aide::openapi::OpenApi;
use axum::body::Bytes;

/// Full OpenAPI spec, pre-serialized at startup and served as raw bytes per request.
#[derive(Clone)]
pub struct OpenApiJson(Bytes);

impl OpenApiJson {
    pub fn new(openapi: &OpenApi) -> Self {
        Self(Bytes::from(serde_json::to_vec(openapi).unwrap()))
    }

    pub fn bytes(&self) -> Bytes {
        self.0.clone()
    }
}