Skip to content

Commit c1513ac

Browse files
Removed JsonStringEnumConverter in the JsonSerializerOptions. (#21)
1 parent 29979e7 commit c1513ac

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

examples/XUMM.NET.ServerApp/Pages/Misc/UserTokens.razor

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757

5858
private async Task VerifyUserTokensAsync()
5959
{
60+
if (string.IsNullOrWhiteSpace(_userTokens))
61+
{
62+
return;
63+
}
64+
6065
var userTokens = Regex.Replace(_userTokens, @"\r\n?|\n", "\r").Split('\r', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
6166
if (userTokens.Length == 0)
6267
{

examples/XUMM.Net.ServerApp/Pages/Payload/SignIn.razor

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@using Microsoft.Extensions.Caching.Memory
55
@using XUMM.NET.SDK.Clients.Interfaces
66
@using XUMM.NET.SDK.Enums
7+
@using XUMM.NET.SDK.Extensions
78
@using XUMM.NET.SDK.WebSocket.EventArgs
89
@using XUMM.NET.SDK.Models.Payload
910
@using XUMM.NET.SDK.Models.Payload.Xumm
@@ -126,12 +127,8 @@
126127

127128
private async Task CreatePayloadAndSubscribe()
128129
{
129-
var serializerOptions = new JsonSerializerOptions { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull };
130-
131-
var payload = new XummPostJsonPayload(JsonSerializer.Serialize(new XummPayloadTransaction(XummTransactionType.SignIn), serializerOptions))
132-
{
133-
CustomMeta = new XummPayloadCustomMeta { Instruction = "Test payload created with the XUMM.NET SDK." }
134-
};
130+
var payload = new XummPayloadTransaction(XummTransactionType.SignIn).ToXummPostJsonPayload();
131+
payload.CustomMeta = new XummPayloadCustomMeta { Instruction = "Test payload created with the XUMM.NET SDK." };
135132

136133
if (!string.IsNullOrWhiteSpace(_customIdentifier))
137134
{

src/XUMM.NET.SDK/Helpers/JsonHelper.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ internal class JsonHelper
88
internal static JsonSerializerOptions SerializerOptions => new JsonSerializerOptions
99
{
1010
#if NET5_0_OR_GREATER
11-
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
11+
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1212
#else
13-
IgnoreNullValues = true,
13+
IgnoreNullValues = true
1414
#endif
15-
Converters =
16-
{
17-
new JsonStringEnumConverter()
18-
}
1915
};
2016
}
2117
}

0 commit comments

Comments
 (0)