Skip to main content

mina_node_native/http_server/
openapi.rs

1//! OpenAPI documentation configuration.
2
3use utoipa::OpenApi;
4
5/// Base OpenAPI documentation with API metadata.
6///
7/// Tags and paths are registered via `utoipa-axum`'s `OpenApiRouter`.
8#[derive(OpenApi)]
9#[openapi(
10    info(
11        title = "Mina Node HTTP RPC",
12        version = env!("CARGO_PKG_VERSION"),
13        description = "HTTP RPC API for Mina Rust node status, state, and operations"
14    ),
15    servers(
16        (url = "http://localhost:3000", description = "Default port of local node")
17    ),
18    tags(
19        (name = "status", description = "Node health and status"),
20        (name = "kubernetes", description = "Kubernetes probe endpoints"),
21        (name = "state", description = "Node state inspection"),
22        (name = "stats", description = "Statistics and metrics"),
23        (name = "scan-state", description = "Scan state inspection"),
24        (name = "snark-pool", description = "SNARK pool management"),
25        (name = "snarker", description = "SNARK worker operations"),
26        (name = "transaction", description = "Transaction pool and accounts"),
27        (name = "discovery", description = "P2P discovery info"),
28        (name = "webrtc", description = "WebRTC signaling"),
29    )
30)]
31pub struct ApiDoc;
32
33/// Stoplight Elements UI (CDN-loaded)
34#[cfg(feature = "stoplight-elements")]
35pub async fn stoplight_elements() -> axum::response::Html<&'static str> {
36    axum::response::Html(include_str!("stoplight_elements.html"))
37}