2021-03-18 10:34:35 +00:00
|
|
|
using System.Text.Json;
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
namespace Myriad.Serialization;
|
|
|
|
|
|
|
|
public class JsonSnakeCaseStringEnumConverter: JsonConverterFactory
|
2021-03-18 10:34:35 +00:00
|
|
|
{
|
2021-11-27 02:10:56 +00:00
|
|
|
private readonly JsonStringEnumConverter _inner = new(new JsonSnakeCaseNamingPolicy());
|
2021-03-18 10:34:35 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public override bool CanConvert(Type typeToConvert) =>
|
|
|
|
_inner.CanConvert(typeToConvert);
|
2021-03-18 10:34:35 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) =>
|
|
|
|
_inner.CreateConverter(typeToConvert, options);
|
2021-03-18 10:34:35 +00:00
|
|
|
}
|