diff --git a/src/trafficgen/write_traffic_situation_to_file.py b/src/trafficgen/write_traffic_situation_to_file.py index fc861e9..c8c578a 100644 --- a/src/trafficgen/write_traffic_situation_to_file.py +++ b/src/trafficgen/write_traffic_situation_to_file.py @@ -19,6 +19,10 @@ def write_traffic_situations_to_json_file(situations: List[Situation], write_fol for i, situation in enumerate(situations): file_number: int = i + 1 output_file_path: Path = write_folder / f"traffic_situation_{file_number:02d}.json" - data: str = situation.model_dump_json(indent=4) + data: str = situation.model_dump_json( + indent=4, + exclude_defaults=True, + exclude_none=True, + ) with open(output_file_path, "w", encoding="utf-8") as outfile: outfile.write(data)