server: openapi fixes

This commit is contained in:
nym21
2025-12-23 20:23:40 +01:00
parent 75a023bdd8
commit f29443fc15
3 changed files with 11 additions and 2 deletions
@@ -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()
+7
View File
@@ -0,0 +1,7 @@
use schemars::JsonSchema;
use serde::Serialize;
/// Hex-encoded string
#[derive(Debug, Clone, Serialize, JsonSchema)]
#[serde(transparent)]
pub struct Hex(String);
+2
View File
@@ -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::*;