Serialize this recipe to JSON.
@override Map<String, dynamic> toJson() => { 'type': 'step_build_recipe', 'steps': steps.map((step) => step.toJson()).toList(), if (needsById.isNotEmpty) 'needs_by_id': needsById, };