Skip to content

Commit

Permalink
added utf-8 encoding for model files
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaDaniel committed Dec 6, 2023
1 parent 79ccb8a commit 5db4d4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bo4e_generator/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def generate_bo4e_schemas(
for relative_file_path, file_content in file_contents.items():
file_path = output_directory / relative_file_path
file_path.parent.mkdir(parents=True, exist_ok=True)
file_path.write_text(file_content)
file_path.write_text(file_content, "utf-8")
print(f"Created {file_path}")

print("Done.")
Expand Down
2 changes: 1 addition & 1 deletion src/bo4e_generator/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def type_map_factory(
strict_types: Sequence[StrictTypes],
pattern_key: str,
) -> dict[Types, DataType]:
"""overwrite the AwareDatetime import"""
result = super().type_map_factory(data_type, strict_types, pattern_key)
result[Types.date_time] = data_type.from_import(IMPORT_DATETIME)
return result
Expand Down Expand Up @@ -179,7 +180,6 @@ def parse_bo4e_schemas(
namespace=namespace,
)
monkey_patch_relative_import()

parser = JsonSchemaParser(
input_directory,
data_model_type=data_model_types.data_model,
Expand Down

0 comments on commit 5db4d4d

Please sign in to comment.