JsonUtility for extend class

hi. firstly sorry for my english
im trying to convert this structure into json with unity jsonUtility:

[Serializable]
public class MainJson
{
    public int x;
    public List<Detail> detail = new List<Detail>();
    public List<type2> type2 = new List<type2>();
    public MainJson()
    {
        x = 10;
        detail.Add(new type1());
        detail.Add(new type2());
        type2.Add(new type2());
    }
}

[Serializable]
public class Detail
{

}

[Serializable]
public class type1 : Detail
{
    public int t1;
    public type1()
    {
        t1 = 1;
    }
}
[Serializable]
public class type2 : Detail
{
    public int t2 = 2;
    public type2()
    {
        t2 = 1;
    }
}

but the output is :

{"x":10,"detail":[{},{}],"type2":[{"t2":1}]}

the classes that extend from another class are added into list but they convert into empty in json.
is it jsonUtility Bug?
or its my class structure fail?
thx for help.

Detail IS a Detail object, type1 and type2 ARE a Detail, however Detail is NOT a type1 or type2. You’re storing using the base class(Detail in this case) and storing them in a List. When serialization occurs it will reflect on what it IS not would is deriving from it. In XML serialization(XMLInclude attribute) there are ways to do this, but they are explicit and do not apply here. Point is you want to serialize what something is, so make a List of type1 and type2 so when serialization occurs they ARE what they are as a base class isn’t going to serialize up your chain of inheritance when you’re using the base class.