Skip to content

Commit

Permalink
Return enum values
Browse files Browse the repository at this point in the history
  • Loading branch information
jsenecal committed Feb 24, 2023
1 parent a78f531 commit 03a6bb3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions regrws/arin_xml_encoder.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from enum import Enum
from typing import Any

from pydantic_xml.serializers import XmlEncoder
Expand All @@ -7,4 +8,6 @@ class ARINXmlEncoder(XmlEncoder):
def encode(self, obj: Any) -> str:
if isinstance(obj, bool):
return "true" if obj else "false"
if isinstance(obj, Enum):
return obj.value
return super().encode(obj)

0 comments on commit 03a6bb3

Please sign in to comment.