What you have doesn't work. What if I have "mi, mo, mfrac, mo, mi" at the top level? So something like "a - b/c + d". You can't specify the same key twice in JSON. Also, keys are technically unordered, so there's no guarantee that a parser will put that top-level "mi" before the "mfrac".
JSON is great at many things, but polymorphic substructures are AFAIK only really possible with everything being an object defining the "type" that it is. And that looks significantly uglier than what you have above:
{
"type": "mrow",
"children": [
{
"type": "mi",
"identifier": "x"
},
{
"type": "mo",
"operator": "="
},
{
"type": "mfrac",
"rows": [
{
"type": "mrow",
"children": [
{
"type": "mo",
"operator": "-"
},
{
"type": "mi",
"identifier": "b"
},
{
"type": "mo",
"operator": "±"
},
{
"type": "sqrt",
"expression": {
"type": "mrow",
"children": [
{
"type": "mi",
"identifier": "b"
},
{
"type": "msup",
"expression": {
"type": "mi",
"identifier": 2
}
},
{
"type": "mo",
"operator": "-"
},
{
"type": "mi",
"identifier": "4ac"
}
]
}
}
]
},
{
"type": "mi",
"identifier": "2a"
}
]
}
]
}