Greenfield: Currency rate should be strings (#4607)

This commit is contained in:
Nicolas Dorier
2023-02-08 19:18:37 +09:00
committed by GitHub
parent 85513aa5c3
commit 7bbfc8e6d4
3 changed files with 7 additions and 2 deletions

View File

@@ -1,10 +1,13 @@
using System.Collections.Generic; using System.Collections.Generic;
using BTCPayServer.JsonConverters;
using Newtonsoft.Json;
namespace BTCPayServer.Client.Models; namespace BTCPayServer.Client.Models;
public class StoreRateResult public class StoreRateResult
{ {
public string CurrencyPair { get; set; } public string CurrencyPair { get; set; }
[JsonConverter(typeof(NumericStringJsonConverter))]
public decimal? Rate { get; set; } public decimal? Rate { get; set; }
public List<string> Errors { get; set; } public List<string> Errors { get; set; }
} }

View File

@@ -1260,6 +1260,7 @@
"rate": { "rate": {
"type": "string", "type": "string",
"format": "decimal", "format": "decimal",
"example": "64392.23",
"description": "The rate between this payment method's currency and the invoice currency" "description": "The rate between this payment method's currency and the invoice currency"
}, },
"paymentMethodPaid": { "paymentMethodPaid": {

View File

@@ -238,8 +238,9 @@
"description": "Errors relating to this currency pair fetching based on your config" "description": "Errors relating to this currency pair fetching based on your config"
}, },
"rate": { "rate": {
"type": "number", "type": "string",
"example": 24520.23, "format": "decimal",
"example": "64392.23",
"description": "the rate fetched based on the currency pair" "description": "the rate fetched based on the currency pair"
} }
} }