mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 14:22:40 +01:00
* Remove deprecated CSS options Closes #5945. * Greenfield: Add brandColor to store APIs Closes #5946. * Migrate file IDs to URLs Closes #5953. * Greenfield: Add CSS and logo URL to store settings API Closes #5945. * Add migration test * Store and Server branding can reference file's via fileid:ID * Add PaymentSoundUrl to Store API --------- Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
29 lines
1 KiB
C#
29 lines
1 KiB
C#
using System;
|
|
using System.Reflection;
|
|
using BTCPayServer.Payouts;
|
|
using NBitcoin.JsonConverters;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace BTCPayServer.JsonConverters
|
|
{
|
|
public class UnresolvedUriJsonConverter : JsonConverter<UnresolvedUri>
|
|
{
|
|
public override UnresolvedUri ReadJson(JsonReader reader, Type objectType, UnresolvedUri existingValue, bool hasExistingValue, JsonSerializer serializer)
|
|
{
|
|
if (reader.TokenType == JsonToken.Null)
|
|
return null;
|
|
if (reader.TokenType != JsonToken.String)
|
|
throw new JsonObjectException("A UnresolvedUri should be a string", reader);
|
|
var str = (string)reader.Value;
|
|
if (str.Length == 0)
|
|
return null;
|
|
return UnresolvedUri.Create(str);
|
|
}
|
|
|
|
public override void WriteJson(JsonWriter writer, UnresolvedUri value, JsonSerializer serializer)
|
|
{
|
|
if (value != null)
|
|
writer.WriteValue(value.ToString());
|
|
}
|
|
}
|
|
}
|