aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/IntegratedTests/CommonJsonSerializeOptions.cs
blob: a14c8eef6cdbee01e7ecb1efab2f4c8390bd460b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System.Text.Json;
using System.Text.Json.Serialization;
using Timeline.Models.Converters;

namespace Timeline.Tests.IntegratedTests
{
    public static class CommonJsonSerializeOptions
    {
        public static JsonSerializerOptions Options { get; }

        static CommonJsonSerializeOptions()
        {
            Options = new JsonSerializerOptions
            {
                PropertyNamingPolicy = JsonNamingPolicy.CamelCase
            };
            Options.Converters.Add(new JsonStringEnumConverter());
            Options.Converters.Add(new JsonDateTimeConverter());
        }
    }
}