Fix Swagger, replacing additionalProperties by allOf

This commit is contained in:
nicolas.dorier
2022-04-21 12:12:30 +09:00
parent 2e08c29c64
commit 9bf3df1e87
6 changed files with 126 additions and 98 deletions

View File

@@ -279,32 +279,36 @@
}
},
"PaymentRequestData": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/PaymentRequestBaseData"
},
"properties": {
"id": {
"type": "string",
"description": "The id of the payment request",
"nullable": false
"allOf": [
{
"$ref": "#/components/schemas/PaymentRequestBaseData"
},
"storeId": {
"type": "string",
"description": "The store identifier that the payment request belongs to"
},
"status": {
"type": "string",
"enum": [ "Pending", "Completed" ,"Expired"],
"description": "The status of the payment request",
"nullable": false
},
"createdTime": {
"description": "The creation date of the payment request",
"allOf": [ {"$ref": "#/components/schemas/UnixTimestamp"}],
"nullable": false
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The id of the payment request",
"nullable": false
},
"storeId": {
"type": "string",
"description": "The store identifier that the payment request belongs to"
},
"status": {
"type": "string",
"enum": [ "Pending", "Completed", "Expired" ],
"description": "The status of the payment request",
"nullable": false
},
"createdTime": {
"description": "The creation date of the payment request",
"allOf": [ { "$ref": "#/components/schemas/UnixTimestamp" } ],
"nullable": false
}
}
}
}
]
},
"PaymentRequestBaseData":{
"type": "object",

View File

@@ -30,12 +30,12 @@
],
"responses": {
"200": {
"description": "list of payment methods",
"description": "List of payment methods",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GenericPaymentMethodData"
}
}

View File

@@ -267,36 +267,44 @@
}
},
"LightningNetworkPaymentMethodData": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/LightningNetworkPaymentMethodBaseData"
},
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether the payment method is enabled"
"allOf": [
{
"$ref": "#/components/schemas/LightningNetworkPaymentMethodBaseData"
},
"cryptoCode": {
"type": "string",
"description": "Crypto code of the payment method"
},
"paymentMethod": {
"type": "string",
"description": "The payment method"
{
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether the payment method is enabled"
},
"cryptoCode": {
"type": "string",
"description": "Crypto code of the payment method"
},
"paymentMethod": {
"type": "string",
"description": "The payment method"
}
}
}
}
]
},
"UpdateLightningNetworkPaymentMethodRequest": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/LightningNetworkPaymentMethodBaseData"
},
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether the payment method is enabled"
"allOf": [
{
"$ref": "#/components/schemas/LightningNetworkPaymentMethodBaseData"
},
{
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether the payment method is enabled"
}
}
}
}
]
}
}
},

View File

@@ -269,20 +269,24 @@
}
},
"LNURLPayPaymentMethodData": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/LNURLPayPaymentMethodBaseData"
},
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether the payment method is enabled. Note that this can only enabled when a Lightning Network payment method is available and enabled"
"allOf": [
{
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether the payment method is enabled. Note that this can only enabled when a Lightning Network payment method is available and enabled"
},
"cryptoCode": {
"type": "string",
"description": "Crypto code of the payment method"
}
}
},
"cryptoCode": {
"type": "string",
"description": "Crypto code of the payment method"
{
"$ref": "#/components/schemas/LNURLPayPaymentMethodBaseData"
}
}
]
}
}
},

View File

@@ -534,44 +534,56 @@
}
},
"UpdateOnChainPaymentMethodRequest": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/OnChainPaymentMethodBaseData"
},
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether the payment method is enabled"
"allOf": [
{
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether the payment method is enabled"
}
}
},
{
"$ref": "#/components/schemas/OnChainPaymentMethodBaseData"
}
}
]
},
"OnChainPaymentMethodData": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/OnChainPaymentMethodDataPreview"
},
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether the payment method is enabled"
"allOf": [
{
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether the payment method is enabled"
},
"paymentMethod": {
"type": "string",
"description": "The payment method"
}
}
},
"paymentMethod": {
"type": "string",
"description": "The payment method"
{
"$ref": "#/components/schemas/OnChainPaymentMethodDataPreview"
}
}
]
},
"OnChainPaymentMethodDataPreview": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/OnChainPaymentMethodBaseData"
},
"properties": {
"cryptoCode": {
"type": "string",
"description": "Crypto code of the payment method"
"allOf": [
{
"$ref": "#/components/schemas/OnChainPaymentMethodBaseData"
},
{
"type": "object",
"properties": {
"cryptoCode": {
"type": "string",
"description": "Crypto code of the payment method"
}
}
}
}
]
},
"OnChainPaymentMethodPreviewResultData": {
"type": "object",

View File

@@ -755,8 +755,8 @@
},
"labels": {
"description": "Labels linked to this transaction",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LabelData"
}
}
@@ -803,8 +803,8 @@
},
"labels": {
"description": "Labels linked to this transaction",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LabelData"
}
}