mirror of
https://github.com/bitwarden/server.git
synced 2026-02-07 17:33:11 +08:00
* 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
21 lines
714 B
C#
21 lines
714 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Bit.Core.Utilities
|
|
{
|
|
public class HandlebarsObjectJsonConverter : JsonConverter<object>
|
|
{
|
|
public override bool CanConvert(Type typeToConvert) => true;
|
|
public override object Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
|
{
|
|
return JsonSerializer.Deserialize<Dictionary<string, object>>(ref reader, options);
|
|
}
|
|
public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions options)
|
|
{
|
|
JsonSerializer.Serialize(writer, value, options);
|
|
}
|
|
}
|
|
}
|