@override Object toJson() => { if (nearestNeighbors.isNotDefault) 'nearestNeighbors': [for (final i in nearestNeighbors) i.toJson()], };