Skip to main content

hyperlane_plugin_openapi/
lib.rs

1//! hyperlane-plugin-openapi
2//!
3//! OpenAPI 3.1.0 specification builder and zero-allocation interactive docs
4//! plugin for Hyperlane serving ETag-cached `/openapi.json` (with `304 Not
5//! Modified`) and a self-contained zero-CDN HTML explorer at `/docs`.
6
7mod r#const;
8mod r#fn;
9mod r#impl;
10mod r#static;
11mod r#struct;
12
13#[cfg(test)]
14#[path = "../tests/mod.rs"]
15mod tests;
16
17pub use {r#const::*, r#struct::*};
18
19pub(crate) use {r#fn::*, r#static::*};
20
21use std::{collections::BTreeMap, hash::Hasher, str::from_utf8, sync::OnceLock};
22
23use {
24    hyperlane::{
25        CACHE_CONTROL, CONTENT_TYPE, Context, ETAG, HttpStatus, Method, Response, ResponseError,
26        ServerHook, Status, Stream, XxHash3_64,
27    },
28    lombok_macros::*,
29    serde::{Deserialize, Serialize},
30    serde_json::{Value, to_vec},
31};