Skip to content

Commit

Permalink
fix: write FlatAHB JSON dict instead of escaped JSON string (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
hf-kklein authored Sep 3, 2024
1 parent e948319 commit 4f5bf6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/kohlrahbi/unfoldedahb/unfoldedahbtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,16 +392,16 @@ def dump_flatahb_json(self, output_directory_path: Path) -> None:
file_content = file.read()
existing_flat_ahb = FlatAnwendungshandbuch.model_validate_json(file_content)
_keep_guids_of_unchanged_lines_stable(flat_ahb, existing_flat_ahb)
dump_data = FlatAnwendungshandbuch.model_dump_json(flat_ahb)
json_dict = flat_ahb.model_dump(mode="json")
with open(file_path, "w", encoding="utf-8") as file:
json.dump(dump_data, file, ensure_ascii=False, indent=2, sort_keys=True)
json.dump(json_dict, file, ensure_ascii=False, indent=2, sort_keys=True)
logger.info(
"The flatahb file for %s is saved at %s",
self.meta_data.pruefidentifikator,
file_path.absolute(),
)
del flat_ahb
del dump_data
del json_dict
if "existing_flat_ahb" in locals():
del existing_flat_ahb

Expand Down

0 comments on commit 4f5bf6b

Please sign in to comment.