Skip to content

Commit

Permalink
utils.publish.generate_schema(): improved formatting of exported json…
Browse files Browse the repository at this point in the history
… schemata. The json files are now indented, hence easier to read by humans.
  • Loading branch information
ClaasRostock committed Feb 22, 2024
1 parent b130839 commit c2fff41
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/maritime_schema/utils/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ def generate_schema(

# Generate json schema
json_file: Path = schema_dir / f"{name}.json"
schema = json.dumps(model.model_json_schema(by_alias=by_alias)) # pyright: ignore
schema = json.dumps(
model.model_json_schema(by_alias=by_alias), # pyright: ignore
indent=4,
)
with open(json_file, "w", encoding="utf-8") as f:
_ = f.write(schema)

Expand Down

0 comments on commit c2fff41

Please sign in to comment.