The QGIS GUI gives a dialog when adding a "multi type GeoJSON", maybe you could dig through the QGIS source to see what QGIS does in the code behind the dialog?
An easy answer would be "Split your input GeoJSON, so that each file contains only one geometry type".
Using ogr2ogr, this will give you 2 shapefiles, one for point and one for line features:
ogr2ogr -f "ESRI Shapefile" -nlt MULTILINESTRING -geomfield GEOM -skipfailures line.shp test.json
ogr2ogr -f "ESRI Shapefile" -nlt POINT -geomfield GEOM -skipfailures point.shp test.json
This is the test.json I tested with:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "this is a line"
},
"geometry": {
"type": "LineString",
"coordinates": [
[
-10.469970703124998,
51.41291212935532
],
[
-8.67919921875,
50.10648772767332
]
]
}
},
{
"type": "Feature",
"properties": {
"name": "this is a point"
},
"geometry": {
"type": "Point",
"coordinates": [
-9.964599609375,
50.43651601698633
]
}
}
]
}