From bf38c7dc1a9ac04e522ad4dc55eb39f26c375f5e Mon Sep 17 00:00:00 2001 From: Jeff Leung Date: Mon, 8 Jan 2024 23:28:35 -0800 Subject: [PATCH] Move away from NewtonSoft.Json --- .../DIScopes/NetBoxBgpCommunities.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AS1024.CommunityDocumentationPage/DIScopes/NetBoxBgpCommunities.cs b/AS1024.CommunityDocumentationPage/DIScopes/NetBoxBgpCommunities.cs index c8bc553..e2c2503 100644 --- a/AS1024.CommunityDocumentationPage/DIScopes/NetBoxBgpCommunities.cs +++ b/AS1024.CommunityDocumentationPage/DIScopes/NetBoxBgpCommunities.cs @@ -1,6 +1,6 @@ using AS1024.CommunityDocumentationPage.Interfaces; using AS1024.CommunityDocumentationPage.Models; -using Newtonsoft.Json; +using System.Text.Json; using System.Net.Http.Headers; namespace AS1024.CommunityDocumentationPage.DIScopes @@ -23,7 +23,9 @@ namespace AS1024.CommunityDocumentationPage.DIScopes HttpResponseMessage result = await client.GetAsync(BuildNetBoxURI()); string stringResult = await result.Content.ReadAsStringAsync(); var temp = - JsonConvert.DeserializeObject(stringResult); + JsonSerializer.Deserialize(stringResult, new JsonSerializerOptions{ + PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower + }); foreach (var route in temp.Results) {