using YamlDotNet.System.Text.Json;

namespace IS_Lab2_JSON_CS;

public static class ConvertJsonToYaml
{
    public static void Run(DeserializeJson deserializeJson, string dest)
    {
        var yaml = YamlConverter.Serialize(deserializeJson.Data.RootElement);
        File.WriteAllText(dest, yaml);
    }
    
    public static void Run(string source, string dest)
    {
        var deserialized = new DeserializeJson(source);
        Run(deserialized, dest);
    }
}