From 3dab64b0f68c1ba94c720ca42c9b1cafbc004e74 Mon Sep 17 00:00:00 2001 From: Czino <42438775+Czino@users.noreply.github.com> Date: Thu, 15 Feb 2024 14:14:55 +0100 Subject: [PATCH] fix: wrong types in swagger (#485) --- lib/api/v2/routers/SwapRouter.ts | 4 +- swagger-spec.json | 322 ++++++++++++++----------------- 2 files changed, 145 insertions(+), 181 deletions(-) diff --git a/lib/api/v2/routers/SwapRouter.ts b/lib/api/v2/routers/SwapRouter.ts index df4511fe..f2bc8ce6 100644 --- a/lib/api/v2/routers/SwapRouter.ts +++ b/lib/api/v2/routers/SwapRouter.ts @@ -94,7 +94,7 @@ class SwapRouter extends RouterBase { * type: number * required: true * description: Maximal amount that can be swapped in satoshis - * maximalZeroConfAmount: + * maximalZeroConf: * type: number * required: true * description: Maximal amount that will be accepted 0-conf in satoshis @@ -705,7 +705,7 @@ class SwapRouter extends RouterBase { * type: string * description: EVM address with which the Reverse Swap can be claimed * invoiceAmount: - * type: string + * type: number * description: Amount for which the invoice should be; conflicts with "onchainAmount" * onchainAmount: * type: string diff --git a/swagger-spec.json b/swagger-spec.json index 8d5a4d3f..7b52707e 100644 --- a/swagger-spec.json +++ b/swagger-spec.json @@ -107,17 +107,15 @@ "tags": [ "Chain" ], - "parameters": [ - { - "in": "path", - "name": "currency", - "required": true, - "schema": { - "type": "string" - }, - "description": "Currency of the chain to get a fee estimation for" - } - ], + "parameters": [{ + "in": "path", + "name": "currency", + "required": true, + "schema": { + "type": "string" + }, + "description": "Currency of the chain to get a fee estimation for" + }], "responses": { "200": { "description": "Object containing the fee estimation", @@ -155,17 +153,15 @@ "tags": [ "Chain" ], - "parameters": [ - { - "in": "path", - "name": "currency", - "required": true, - "schema": { - "type": "string" - }, - "description": "Currency of the chain to get the block height for" - } - ], + "parameters": [{ + "in": "path", + "name": "currency", + "required": true, + "schema": { + "type": "string" + }, + "description": "Currency of the chain to get the block height for" + }], "responses": { "200": { "description": "Object containing the block height", @@ -203,8 +199,7 @@ "Chain" ], "description": "Fetch a raw transaction by its id", - "parameters": [ - { + "parameters": [{ "in": "path", "name": "currency", "required": true, @@ -260,17 +255,15 @@ "Chain" ], "description": "Broadcast a transaction", - "parameters": [ - { - "in": "path", - "name": "currency", - "required": true, - "schema": { - "type": "string" - }, - "description": "Currency of the chain to broadcast on" - } - ], + "parameters": [{ + "in": "path", + "name": "currency", + "required": true, + "schema": { + "type": "string" + }, + "description": "Currency of the chain to broadcast on" + }], "requestBody": { "required": true, "content": { @@ -325,17 +318,15 @@ "Chain" ], "description": "Get the network information and contract addresses for a supported EVM chains", - "parameters": [ - { - "in": "path", - "name": "currency", - "required": true, - "schema": { - "type": "string" - }, - "description": "Currency of the chain to query for" - } - ], + "parameters": [{ + "in": "path", + "name": "currency", + "required": true, + "schema": { + "type": "string" + }, + "description": "Currency of the chain to query for" + }], "responses": { "200": { "description": "Raw transaction", @@ -517,8 +508,7 @@ "tags": [ "Referral" ], - "parameters": [ - { + "parameters": [{ "in": "header", "name": "TS", "required": true, @@ -583,8 +573,7 @@ "tags": [ "Referral" ], - "parameters": [ - { + "parameters": [{ "in": "header", "name": "TS", "required": true, @@ -660,8 +649,7 @@ "tags": [ "Referral" ], - "parameters": [ - { + "parameters": [{ "in": "header", "name": "TS", "required": true, @@ -845,17 +833,15 @@ "Submarine" ], "description": "Set the invoice for a Submarine Swap", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "description": "ID of the Submarine Swap" - } - ], + "parameters": [{ + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "description": "ID of the Submarine Swap" + }], "requestBody": { "required": true, "content": { @@ -923,17 +909,15 @@ "Submarine" ], "description": "Get the expected amount of the invoice that should be set after the Swap was created with a preimage hash and an onchain transaction was sent", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "description": "ID of the Submarine Swap" - } - ], + "parameters": [{ + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "description": "ID of the Submarine Swap" + }], "responses": { "200": { "description": "Expected amount of the invoice", @@ -971,17 +955,15 @@ "Submarine" ], "description": "Get the lockup transaction of a Submarine Swap", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "description": "ID of the Submarine Swap" - } - ], + "parameters": [{ + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "description": "ID of the Submarine Swap" + }], "responses": { "200": { "description": "The lockup transaction of the Submarine Swap and accompanying information", @@ -1012,17 +994,15 @@ "Submarine" ], "description": "Get an EIP-712 signature for a cooperative EVM refund", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "description": "ID of the Swap" - } - ], + "parameters": [{ + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "description": "ID of the Swap" + }], "responses": { "200": { "description": "EIP-712 signature", @@ -1057,17 +1037,15 @@ "tags": [ "Submarine" ], - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "description": "ID of the Swap" - } - ], + "parameters": [{ + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "description": "ID of the Swap" + }], "requestBody": { "required": true, "content": { @@ -1108,17 +1086,15 @@ "Submarine" ], "description": "Get the needed information to post a partial signature for a cooperative Submarine Swap claim transaction", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "description": "ID of the Swap" - } - ], + "parameters": [{ + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "description": "ID of the Swap" + }], "responses": { "200": { "description": "The latest status of the Swap", @@ -1157,17 +1133,15 @@ "Submarine" ], "description": "Send Boltz the clients partial signature for a cooperative Submarine Swap claim transaction", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "description": "ID of the Swap" - } - ], + "parameters": [{ + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "description": "ID of the Swap" + }], "requestBody": { "required": true, "content": { @@ -1287,17 +1261,15 @@ "Reverse" ], "description": "Get the lockup transaction of a Reverse Swap", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "description": "ID of the Reverse Swap" - } - ], + "parameters": [{ + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "description": "ID of the Reverse Swap" + }], "responses": { "200": { "description": "The lockup transaction of the Reverse Swap and accompanying information", @@ -1328,17 +1300,15 @@ "tags": [ "Reverse" ], - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "description": "ID of the Swap" - } - ], + "parameters": [{ + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "description": "ID of the Swap" + }], "requestBody": { "required": true, "content": { @@ -1379,17 +1349,15 @@ "Reverse" ], "description": "Get the BIP-21 of a Reverse Swap for a direct payment", - "parameters": [ - { - "in": "path", - "name": "invoice", - "required": true, - "schema": { - "type": "string" - }, - "description": "Invoice of the Reverse Swap" - } - ], + "parameters": [{ + "in": "path", + "name": "invoice", + "required": true, + "schema": { + "type": "string" + }, + "description": "Invoice of the Reverse Swap" + }], "responses": { "200": { "description": "BIP-21 and signature to prove the authenticity of the BIP-21", @@ -1430,17 +1398,15 @@ "Swap" ], "description": "Get the status of a Swap", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "description": "ID of the Swap" - } - ], + "parameters": [{ + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "description": "ID of the Swap" + }], "responses": { "200": { "description": "The latest status of the Swap", @@ -1612,7 +1578,7 @@ "required": true, "description": "Maximal amount that can be swapped in satoshis" }, - "maximalZeroConfAmount": { + "maximalZeroConf": { "type": "number", "required": true, "description": "Maximal amount that will be accepted 0-conf in satoshis" @@ -1881,7 +1847,7 @@ "description": "EVM address with which the Reverse Swap can be claimed" }, "invoiceAmount": { - "type": "string", + "type": "number", "description": "Amount for which the invoice should be; conflicts with \"onchainAmount\"" }, "onchainAmount": { @@ -2034,8 +2000,7 @@ } } }, - "tags": [ - { + "tags": [{ "name": "Chain", "description": "Onchain data related endpoints" }, @@ -2064,8 +2029,7 @@ "description": "Generic Swap related endpoints" } ], - "servers": [ - { + "servers": [{ "url": "https://api.boltz.exchange/v2", "description": "Mainnet" },