Skip to content

Commit 897d2b6

Browse files
author
Bart Koelman
committed
Switched to STJ in Microservices example
1 parent c68a5c6 commit 897d2b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/JsonApiDotNetCoreTests/IntegrationTests/Microservices/Messages/OutgoingMessage.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
using System.Text.Json;
12
using JetBrains.Annotations;
2-
using Newtonsoft.Json;
33

44
namespace JsonApiDotNetCoreTests.IntegrationTests.Microservices.Messages
55
{
@@ -17,7 +17,7 @@ public T GetContentAs<T>()
1717
string namespacePrefix = typeof(IMessageContent).Namespace;
1818
var contentType = System.Type.GetType($"{namespacePrefix}.{Type}", true);
1919

20-
return (T)JsonConvert.DeserializeObject(Content, contentType);
20+
return (T)JsonSerializer.Deserialize(Content, contentType);
2121
}
2222

2323
public static OutgoingMessage CreateFromContent(IMessageContent content)
@@ -26,7 +26,7 @@ public static OutgoingMessage CreateFromContent(IMessageContent content)
2626
{
2727
Type = content.GetType().Name,
2828
FormatVersion = content.FormatVersion,
29-
Content = JsonConvert.SerializeObject(content)
29+
Content = JsonSerializer.Serialize(content, content.GetType())
3030
};
3131
}
3232
}

0 commit comments

Comments
 (0)