mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-06-05 12:41:57 -07:00
server: openapi fixes
This commit is contained in:
@@ -5,7 +5,7 @@ use axum::{
|
||||
response::Redirect,
|
||||
routing::get,
|
||||
};
|
||||
use brk_types::{Transaction, TxOutspend, TxStatus, TxidParam, TxidVout};
|
||||
use brk_types::{Hex, Transaction, TxOutspend, TxStatus, TxidParam, TxidVout};
|
||||
|
||||
use crate::{CacheStrategy, extended::TransformResponseExtended};
|
||||
|
||||
@@ -82,7 +82,7 @@ impl TxRoutes for ApiRouter<AppState> {
|
||||
.description(
|
||||
"Retrieve the raw transaction as a hex-encoded string. Returns the serialized transaction in hexadecimal format.",
|
||||
)
|
||||
.ok_response::<String>()
|
||||
.ok_response::<Hex>()
|
||||
.not_modified()
|
||||
.bad_request()
|
||||
.not_found()
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
use schemars::JsonSchema;
|
||||
use serde::Serialize;
|
||||
|
||||
/// Hex-encoded string
|
||||
#[derive(Debug, Clone, Serialize, JsonSchema)]
|
||||
#[serde(transparent)]
|
||||
pub struct Hex(String);
|
||||
@@ -58,6 +58,7 @@ mod hashratesummary;
|
||||
mod health;
|
||||
mod height;
|
||||
mod heightparam;
|
||||
mod hex;
|
||||
mod index;
|
||||
mod indexinfo;
|
||||
mod limit;
|
||||
@@ -211,6 +212,7 @@ pub use hashratesummary::*;
|
||||
pub use health::*;
|
||||
pub use height::*;
|
||||
pub use heightparam::*;
|
||||
pub use hex::*;
|
||||
pub use index::*;
|
||||
pub use indexinfo::*;
|
||||
pub use limit::*;
|
||||
|
||||
Reference in New Issue
Block a user