using Newtonsoft.Json.Linq;
public static void Main()
""name"": ""Classic Margherita Pizza"",
""Fresh mozzarella cheese"",
""Salt and pepper to taste""
""Preheat the oven to 475°F (245°C)."",
""Roll out the pizza dough and spread tomato sauce evenly."",
""Top with slices of fresh mozzarella and fresh basil leaves."",
""Drizzle with olive oil and season with salt and pepper."",
""Bake in the preheated oven for 12-15 minutes or until the crust is golden brown."",
""difficulty"": ""Easy"",
""cuisine"": ""Italian"",
""caloriesPerServing"": 300,
""image"": ""https://cdn.dummyjson.com/recipe-images/1.webp"",
var jObject= JObject.Parse(jsonString);
var origJobject = JsonConvert.SerializeObject(jObject);
var flattened = jObject.Flatten();
var flattenedString = JsonConvert.SerializeObject(flattened, Formatting.Indented);
Console.WriteLine(origJobject);
Console.WriteLine("************************************");
Console.WriteLine(flattenedString);