@@ -5,7 +5,7 @@ use crate::api::{
55use axum:: extract:: { Query , State } ;
66use axum:: Json ;
77use ethers:: types:: TxHash ;
8- use utoipa:: IntoParams ;
8+ use utoipa:: { IntoParams , ToSchema } ;
99
1010#[ derive( Debug , serde:: Serialize , serde:: Deserialize , IntoParams ) ]
1111#[ into_params( parameter_in=Query ) ]
@@ -20,7 +20,7 @@ pub struct ExplorerQueryParams {
2020 #[ param( value_type = Option <String >) ]
2121 pub chain_id : Option < ChainId > ,
2222}
23- #[ derive( Debug , serde:: Serialize , serde:: Deserialize ) ]
23+ #[ derive( Debug , serde:: Serialize , serde:: Deserialize , ToSchema ) ]
2424#[ serde( rename_all = "kebab-case" ) ]
2525pub enum ExplorerQueryParamsMode {
2626 TxHash ,
@@ -31,14 +31,13 @@ pub enum ExplorerQueryParamsMode {
3131
3232#[ utoipa:: path(
3333 get,
34- path = "/v1/explorer/ " ,
34+ path = "/v1/explorer" ,
3535 responses(
36- ( status = 200 , description = "Random value successfully retrieved" , body = GetRandomValueResponse ) ,
37- ( status = 403 , description = "Random value cannot currently be retrieved" , body = String )
36+ ( status = 200 , description = "Random value successfully retrieved" , body = Vec <RequestJournal >)
3837 ) ,
3938 params( ExplorerQueryParams )
4039) ]
41- pub async fn get_requests (
40+ pub async fn explorer (
4241 State ( state) : State < crate :: api:: ApiState > ,
4342 Query ( query_params) : Query < ExplorerQueryParams > ,
4443) -> anyhow:: Result < Json < Vec < RequestJournal > > , RestError > {
0 commit comments