using System.Text.Json;
using System.Text.Json.Serialization;

namespace StellaOps.Scanner.Core.Serialization;

public static class ScannerJsonOptions
{
    public static JsonSerializerOptions Default { get; } = CreateDefault();

    public static JsonSerializerOptions CreateDefault(bool indent = false)
    {
        var options = new JsonSerializerOptions(JsonSerializerDefaults.Web)
        {
            WriteIndented = indent
        };

        options.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase));

        return options;
    }
}
