Move away from Newtonsoft.Json
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using AS1024.GeoFeed.Interfaces;
|
||||
using AS1024.GeoFeed.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System.Text.Json;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Sockets;
|
||||
using System.Web;
|
||||
@@ -49,7 +49,9 @@ namespace AS1024.GeoFeed.GeoFeedBuilder
|
||||
if (result.IsSuccessStatusCode)
|
||||
{
|
||||
string stringResult = await result.Content.ReadAsStringAsync();
|
||||
jsonData = JsonConvert.DeserializeObject<NetboxData>(stringResult);
|
||||
jsonData = JsonSerializer.Deserialize<NetboxData>(stringResult, new JsonSerializerOptions {
|
||||
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower
|
||||
});
|
||||
|
||||
if (jsonData?.Results == null || jsonData.Results.Count == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user