mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 21:32:27 +01:00
Prevent duplicate array entries when merging Swagger JSON
This commit is contained in:
parent
25d40972be
commit
5783db9eda
@ -92,7 +92,10 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
await using var stream = fi.CreateReadStream();
|
||||
using var reader = new StreamReader(fi.CreateReadStream());
|
||||
json.Merge(JObject.Parse(await reader.ReadToEndAsync()));
|
||||
json.Merge(JObject.Parse(await reader.ReadToEndAsync()), new JsonMergeSettings
|
||||
{
|
||||
MergeArrayHandling = MergeArrayHandling.Union // Prevent duplicates
|
||||
});
|
||||
}
|
||||
var servers = new JArray();
|
||||
servers.Add(new JObject(new JProperty("url", HttpContext.Request.GetAbsoluteRoot())));
|
||||
|
Loading…
Reference in New Issue
Block a user