Compare commits

...

2 Commits

Author SHA1 Message Date
48a1d6f984 Migrate to json deserializer 2024-01-11 16:18:39 -08:00
79090e91d6 Remove newtonsoft reference 2024-01-11 16:12:55 -08:00

View File

@@ -1,9 +1,7 @@
using AS1024.CommunityDocumentationPage.Interfaces;
using AS1024.CommunityDocumentationPage.Models;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using System.Net.Http.Headers;
using System.Runtime.CompilerServices;
using System.Text.Json;
namespace AS1024.CommunityDocumentationPage.DIScopes
{
@@ -25,7 +23,8 @@ namespace AS1024.CommunityDocumentationPage.DIScopes
HttpResponseMessage result = await client.GetAsync(BuildNetBoxURI());
string stringResult = await result.Content.ReadAsStringAsync();
#pragma warning disable CS8603 // Possible null reference return.
return JsonConvert.DeserializeObject<RouteTargets>(stringResult);
return JsonSerializer.Deserialize<RouteTargets>(stringResult,
new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower });
#pragma warning restore CS8603 // Possible null reference return.
}