Custom json serialization, dictionary keys to parent object

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}

There is no option, the DTO needs to match the shape of the JSON that’s serialized, so it just needs to be a property on the DTO:

public class Component
{
    public string Id { get; set; }
    public bool Required { get; set; }
}