Skip to content

Commit

Permalink
Fixing class name for enums
Browse files Browse the repository at this point in the history
  • Loading branch information
petervanthof committed Feb 21, 2022
1 parent caa819f commit 185f754
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pydantic_avro/avro_to_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_python_type(t: Union[str, dict]) -> str:
elif t.get("type") == "enum":
enum_name = t.get("name")
if enum_name not in classes:
enum_class = "class Status(str, Enum):\n"
enum_class = f"class {enum_name}(str, Enum):\n"
for s in t.get("symbols"):
enum_class += f' {s} = "{s}"\n'
classes[enum_name] = enum_class
Expand Down

0 comments on commit 185f754

Please sign in to comment.