Skip to main content

hyperlane_plugin_openapi/
const.rs

1/// OpenAPI specification version emitted by [`OpenApiSpec`].
2pub const OPENAPI_VERSION: &str = "3.1.0";
3
4/// Default path serving the pre-serialized OpenAPI JSON document.
5pub const DEFAULT_SPEC_PATH: &str = "/openapi.json";
6
7/// Default path serving the self-contained interactive HTML API documentation explorer.
8pub const DEFAULT_DOCS_PATH: &str = "/docs";
9
10/// Default `Cache-Control` header applied to OpenAPI specification and docs responses.
11pub const DEFAULT_OPENAPI_CACHE_CONTROL: &str = "public, max-age=300";
12
13/// JSON media type for `/openapi.json`.
14pub(crate) const CONTENT_TYPE_JSON: &str = "application/json; charset=utf-8";
15
16/// HTML media type for `/docs`.
17pub(crate) const CONTENT_TYPE_HTML: &str = "text/html; charset=utf-8";
18
19/// Lowercase hexadecimal digits for ETag formatting.
20pub(crate) const HEX_LOWER: &[u8; 16] = b"0123456789abcdef";
21
22/// Default API title when constructed via `Default`.
23pub(crate) const DEFAULT_API_TITLE: &str = "Hyperlane API";
24
25/// Default API version when constructed via `Default`.
26pub(crate) const DEFAULT_API_VERSION: &str = "1.0.0";