diff --git a/Cargo.lock b/Cargo.lock index 14d243eca7..ce113eacc1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6428,7 +6428,7 @@ dependencies = [ "nym-crypto", "nym-noise-keys", "pin-project", - "sha2 0.10.8", + "sha2 0.10.9", "snow", "strum 0.26.3", "thiserror 2.0.12", diff --git a/nym-api/src/nym_nodes/handlers/unstable/semi_skimmed.rs b/nym-api/src/nym_nodes/handlers/unstable/semi_skimmed.rs index 572ba25a19..77aac9c9a6 100644 --- a/nym-api/src/nym_nodes/handlers/unstable/semi_skimmed.rs +++ b/nym-api/src/nym_nodes/handlers/unstable/semi_skimmed.rs @@ -7,7 +7,6 @@ use crate::nym_nodes::handlers::unstable::helpers::{refreshed_at, LegacyAnnotati use crate::nym_nodes::handlers::unstable::NodesParamsWithRole; use crate::support::http::state::AppState; use axum::extract::{Query, State}; -use axum::Json; use nym_api_requests::models::{ NodeAnnotation, NymNodeDescription, OffsetDateTimeJsonSchemaWrapper, }; @@ -99,12 +98,16 @@ pub struct PaginatedCachedNodesExpandedResponseSchema { path = "", context_path = "/v1/unstable/nym-nodes/semi-skimmed", responses( - (status = 200, body = PaginatedCachedNodesExpandedResponseSchema) + (status = 200, content( + (PaginatedCachedNodesExpandedResponseSchema = "application/json"), + (PaginatedCachedNodesExpandedResponseSchema = "application/yaml"), + (PaginatedCachedNodesExpandedResponseSchema = "application/bincode") + )) ) )] pub(super) async fn nodes_expanded( state: State, - _query_params: Query, + query_params: Query, ) -> PaginatedSemiSkimmedNodes { // 1. grab all relevant described nym-nodes let rewarded_set = state.rewarded_set().await?; @@ -132,8 +135,6 @@ pub(super) async fn nodes_expanded( legacy_gateways.timestamp(), ]); - Ok(Json(PaginatedCachedNodesResponse::new_full( - refreshed_at, - nodes, - ))) + let output = query_params.output.unwrap_or_default(); + Ok(output.to_response(PaginatedCachedNodesResponse::new_full(refreshed_at, nodes))) }