Skip to content

Commit

Permalink
Adding by_alias to json converter in PydanticJsonFileEntityLoader (#75)
Browse files Browse the repository at this point in the history
Co-authored-by: Leon Haffmans <[email protected]>
  • Loading branch information
hamidhajiparvaneh and lord-haffi authored May 30, 2023
1 parent a3a42af commit 2911ff7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bomf/loader/entityloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,6 @@ class PydanticJsonFileEntityLoader(JsonFileEntityLoader[_PydanticTargetModel], G
def __init__(self, file_path: Path):
"""provide a file path"""
super().__init__(
file_path=file_path, list_encoder=lambda x: json.loads(_ListOfPydanticModels(__root__=x).json())
file_path=file_path,
list_encoder=lambda x: json.loads(_ListOfPydanticModels(__root__=x).json(by_alias=True)),
)

0 comments on commit 2911ff7

Please sign in to comment.