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 4b1f6bb
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 118 deletions.
210 changes: 93 additions & 117 deletions crates/jstz_node/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -676,145 +676,121 @@
"ReceiptResult_ReceiptContent": {
"oneOf": [
{
"allOf": [
"oneOf": [
{
"oneOf": [
"allOf": [
{
"allOf": [
{
"$ref": "#/components/schemas/DeployFunctionReceipt"
},
{
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"DeployFunction"
]
}
}
}
]
"$ref": "#/components/schemas/DeployFunctionReceipt"
},
{
"allOf": [
{
"$ref": "#/components/schemas/RunFunctionReceipt"
},
{
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"RunFunction"
]
}
}
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"DeployFunction"
]
}
]
}
}
],
"title": "DeployFunction"
},
{
"allOf": [
{
"$ref": "#/components/schemas/RunFunctionReceipt"
},
{
"allOf": [
{
"$ref": "#/components/schemas/DepositReceipt"
},
{
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"Deposit"
]
}
}
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"RunFunction"
]
}
]
}
}
],
"title": "RunFunction"
},
{
"allOf": [
{
"$ref": "#/components/schemas/DepositReceipt"
},
{
"allOf": [
{
"$ref": "#/components/schemas/FaDepositReceipt"
},
{
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"FaDeposit"
]
}
}
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"Deposit"
]
}
]
}
}
],
"title": "Deposit"
},
{
"allOf": [
{
"$ref": "#/components/schemas/FaDepositReceipt"
},
{
"allOf": [
{
"$ref": "#/components/schemas/FaWithdrawReceipt"
},
{
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"FaWithdraw"
]
}
}
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"FaDeposit"
]
}
]
}
}
]
],
"title": "FaDeposit"
},
{
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"Ok"
]
"allOf": [
{
"$ref": "#/components/schemas/FaWithdrawReceipt"
},
{
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"FaWithdraw"
]
}
}
}
}
],
"title": "FaWithdraw"
}
]
},
{
"type": "object",
"required": [
"_type"
],
"properties": {
"_type": {
"type": "string",
"enum": [
"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 4b1f6bb

Please sign in to comment.