What is the best way to serialize the dictionary items to the parent als key/value?
public class Component
{
public string Id { get; set; }
public Dictionary<string, object> CustomProperties { get; set; }
public string Type { get; set; }
}
Component component = new Component() { Id = "123" };
component.CustomProperties = new Dictionary<string, object>();
component.CustomProperties.Add("required", true);
//component.CustomProperties.Add("required", new Component());
to get this json result:
{"id":"123", "required":true}