Skip to content

Commit d09e375

Browse files
committed
fix openapi response types
1 parent 685fc80 commit d09e375

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

server/src/http/routes/contract_write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl ContractWrite {
8282
tag = "Write",
8383
request_body(content = WriteContractRequest, description = "Write contract request", content_type = "application/json"),
8484
responses(
85-
(status = 202, description = "Transaction(s) queued successfully", body = QueuedTransactionsResponse, content_type = "application/json",
85+
(status = 202, description = "Transaction(s) queued successfully", body = SuccessResponse<QueuedTransactionsResponse>, content_type = "application/json",
8686
example = json!({"transactions": [{"id": "1", "batchIndex": 0, "executionParams": {"chainId": 1, "idempotencyKey": "123", "executorType": "ERC4337"}, "transactionParams": [{"to": "0x123", "data": "0x123", "value": "0x123"}]}]})
8787
),
8888
),

server/src/http/routes/transaction_write.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// 8:12 PM - COLOCATION: Transaction Write Operations
22

33
use axum::{
4-
debug_handler, extract::State, http::StatusCode,
4+
debug_handler,
5+
extract::State,
6+
http::StatusCode,
57
response::{IntoResponse, Json},
68
};
79
use engine_core::execution_options::{QueuedTransactionsResponse, SendTransactionRequest};
@@ -22,7 +24,7 @@ use crate::http::{
2224
tag = "Write",
2325
request_body(content = SendTransactionRequest, description = "Transaction request", content_type = "application/json"),
2426
responses(
25-
(status = 202, description = "Transaction queued successfully", body = QueuedTransactionsResponse, content_type = "application/json"),
27+
(status = 202, description = "Transaction queued successfully", body = SuccessResponse<QueuedTransactionsResponse>, content_type = "application/json"),
2628
),
2729
params(
2830
("x-thirdweb-client-id" = Option<String>, Header, description = "Thirdweb client ID, passed along with the service key"),
@@ -32,7 +34,7 @@ use crate::http::{
3234
)
3335
)]
3436
/// Write Transaction
35-
///
37+
///
3638
/// Execute raw transactions
3739
#[debug_handler]
3840
pub async fn write_transaction(
@@ -70,4 +72,3 @@ pub async fn write_transaction(
7072
})),
7173
))
7274
}
73-

server/src/http/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use engine_core::error::EngineError;
33
use schemars::JsonSchema;
44
use serde::{Deserialize, Serialize};
55

6-
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, OperationIo)]
6+
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, OperationIo, utoipa::ToSchema)]
77
pub struct SuccessResponse<T> {
88
pub result: T,
99
}

0 commit comments

Comments
 (0)