@@ -7,7 +7,6 @@ use crate::nym_nodes::handlers::unstable::helpers::{refreshed_at, LegacyAnnotati
7
7
use crate :: nym_nodes:: handlers:: unstable:: NodesParamsWithRole ;
8
8
use crate :: support:: http:: state:: AppState ;
9
9
use axum:: extract:: { Query , State } ;
10
- use axum:: Json ;
11
10
use nym_api_requests:: models:: {
12
11
NodeAnnotation , NymNodeDescription , OffsetDateTimeJsonSchemaWrapper ,
13
12
} ;
@@ -99,12 +98,16 @@ pub struct PaginatedCachedNodesExpandedResponseSchema {
99
98
path = "" ,
100
99
context_path = "/v1/unstable/nym-nodes/semi-skimmed" ,
101
100
responses(
102
- ( status = 200 , body = PaginatedCachedNodesExpandedResponseSchema )
101
+ ( status = 200 , content(
102
+ ( PaginatedCachedNodesExpandedResponseSchema = "application/json" ) ,
103
+ ( PaginatedCachedNodesExpandedResponseSchema = "application/yaml" ) ,
104
+ ( PaginatedCachedNodesExpandedResponseSchema = "application/bincode" )
105
+ ) )
103
106
)
104
107
) ]
105
108
pub ( super ) async fn nodes_expanded (
106
109
state : State < AppState > ,
107
- _query_params : Query < NodesParamsWithRole > ,
110
+ query_params : Query < NodesParamsWithRole > ,
108
111
) -> PaginatedSemiSkimmedNodes {
109
112
// 1. grab all relevant described nym-nodes
110
113
let rewarded_set = state. rewarded_set ( ) . await ?;
@@ -132,8 +135,6 @@ pub(super) async fn nodes_expanded(
132
135
legacy_gateways. timestamp ( ) ,
133
136
] ) ;
134
137
135
- Ok ( Json ( PaginatedCachedNodesResponse :: new_full (
136
- refreshed_at,
137
- nodes,
138
- ) ) )
138
+ let output = query_params. output . unwrap_or_default ( ) ;
139
+ Ok ( output. to_response ( PaginatedCachedNodesResponse :: new_full ( refreshed_at, nodes) ) )
139
140
}
0 commit comments