Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions api-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,16 @@ async fn main() -> Result<()> {
Ok(())
}

/// Serves the generated OpenAPI spec as JSON at `/openapi.json`.
async fn openapi_json() -> Json<utoipa::openapi::OpenApi> {
Json(ApiDoc::openapi())
}

/// Attach a unique `request_id` (UUID v4) to every request span and response header.
///
/// All logs emitted while handling the request inherit the `request_id` field
/// from the enclosing span, enabling correlation across log lines for a single
/// request. The ID is also returned to the client in the `X-Request-Id` header.
async fn openapi_json() -> Json<utoipa::openapi::OpenApi> {
Json(ApiDoc::openapi())
}

async fn request_id_middleware(req: Request<axum::body::Body>, next: Next) -> Response {
let request_id = uuid::Uuid::new_v4().to_string();
let method = req.method().clone();
Expand Down
15 changes: 1 addition & 14 deletions api-server/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@ pub struct SimulationDetail {
pub would_succeed: bool,
}

#[allow(dead_code)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RouteBreakdown {
pub route_name: String,
pub version: u32,
pub target_contract: String,
pub function: String,
}

/// Machine-readable error codes for API error responses.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, ToSchema)]
Expand Down Expand Up @@ -179,9 +171,4 @@ pub struct SubscribeMessage {
pub tx_id: String,
}

#[allow(dead_code)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WsMessage {
pub msg_type: String,
pub data: serde_json::Value,
}

Loading