Skip to content

Commit

Permalink
fix: remove tag from receipt result container
Browse files Browse the repository at this point in the history
  • Loading branch information
zcabter committed Nov 14, 2024
1 parent c7a420d commit e9cb0b9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
33 changes: 10 additions & 23 deletions crates/jstz_node/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,12 @@
"ReceiptResult_ReceiptContent": {
"oneOf": [
{
"allOf": [
{
"type": "object",
"required": [
"Ok"
],
"properties": {
"Ok": {
"oneOf": [
{
"allOf": [
Expand Down Expand Up @@ -785,34 +789,17 @@
]
}
]
},
{
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"Ok"
]
}
}
}
]
}
},
{
"type": "object",
"required": [
"_type"
"Err"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"Err"
]
"Err": {
"type": "string"
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion crates/jstz_proto/src/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,15 @@ pub struct DepositReceipt {
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[serde(tag = "_type")]
pub enum ReceiptContent {
#[schema(title = "DeployFunction")]
DeployFunction(DeployFunctionReceipt),
#[schema(title = "RunFunction")]
RunFunction(RunFunctionReceipt),
#[schema(title = "Deposit")]
Deposit(DepositReceipt),
#[schema(title = "FaDeposit")]
FaDeposit(FaDepositReceipt),
#[schema(title = "FaWithdraw")]
FaWithdraw(FaWithdrawReceipt),
}

Expand All @@ -72,7 +77,7 @@ mod openapi {

#[allow(dead_code)]
#[derive(ToSchema, Serialize, Deserialize)]
#[serde(tag = "_type")]
#[serde(untagged)]
pub enum ReceiptResult<T: ToSchema> {
Ok(T),
Err(String),
Expand Down

0 comments on commit e9cb0b9

Please sign in to comment.