1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

Start Migration from Newtonsoft.Json to System.Text.Json (#1803)

* Start switch to System.Text.Json

* Work on switching to System.Text.Json

* Main work on STJ refactor

* Fix build errors

* Run formatting

* Delete unused file

* Use legacy for two factor providers

* Run formatter

* Add TokenProviderTests

* Run formatting

* Fix merge issues

* Switch to use JsonSerializer

* Address PR feedback

* Fix formatting

* Ran formatter

* Switch to async

* Ensure Enums are serialized as strings

* Fix formatting

* Enqueue single items as arrays

* Remove CreateAsync method on AzureQueueService
This commit is contained in:
Justin Baur
2022-01-21 09:36:25 -05:00
committed by GitHub
parent 897a76ff48
commit 5268f2781e
91 changed files with 974 additions and 698 deletions

View File

@ -3,8 +3,8 @@ using System.Collections.Generic;
using System.Data.SqlClient;
using System.Globalization;
using System.Net.Http;
using System.Text.Json;
using Bit.Migrator;
using Newtonsoft.Json;
namespace Bit.Setup
{
@ -273,8 +273,9 @@ namespace Bit.Setup
}
var resultString = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
var result = JsonConvert.DeserializeObject<dynamic>(resultString);
if (!(bool)result.Enabled)
using var jsonDocument = JsonSerializer.Deserialize<JsonDocument>(resultString);
var root = jsonDocument.RootElement;
if (!root.GetProperty("Enabled").GetBoolean())
{
Console.WriteLine("Installation id has been disabled.");
return false;

View File

@ -12,7 +12,6 @@
<ItemGroup>
<PackageReference Include="Handlebars.Net" Version="1.10.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="YamlDotNet" Version="8.1.2" />
</ItemGroup>