diff --git a/geomagio/pydantic_utcdatetime.py b/geomagio/pydantic_utcdatetime.py
index 9e852d2a926d59649ab1488b34aa9074d2eaa55b..e2d029938fd608b6cfab451278b9286b9a103850 100644
--- a/geomagio/pydantic_utcdatetime.py
+++ b/geomagio/pydantic_utcdatetime.py
@@ -1,8 +1,13 @@
 """Configure pydantic to allow UTCDateTime attributes on models.
 """
+
 from datetime import datetime
 from typing import Any, Callable, Dict, List, Tuple, TypeVar, Union
 
+# FIXME: migrating to pydantic v2 should make this unnecessary
+#        (other changes will be needed though)
+from fastapi.encoders import ENCODERS_BY_TYPE
+
 from obspy import UTCDateTime
 from pydantic.errors import PydanticValueError
 import pydantic.json
@@ -29,6 +34,11 @@ def register_custom_pydantic_type(
         pass
     # add encoder
     pydantic.json.ENCODERS_BY_TYPE[custom_type] = encoder
+
+    # FIXME: migrating to pydantic v2 should make this unnecessary
+    #        (other changes will be needed though)
+    ENCODERS_BY_TYPE[custom_type] = encoder
+
     # add openapi mapping
     pydantic.schema.field_class_to_schema += ((custom_type, json_schema),)
     # add validator
@@ -46,38 +56,12 @@ def format_utcdatetime(o: UTCDateTime) -> str:
 
 
 def parse_utcdatetime(
-    value: Union[datetime, float, int, str, UTCDateTime, Dict]
+    value: Union[datetime, float, int, str, UTCDateTime]
 ) -> UTCDateTime:
-    if isinstance(value, UTCDateTime):
-        # If the value is already a UTCDateTime, return it directly
-        return value
-    elif isinstance(value, dict):
-        # Handle the nanosecond dictionary format
-        try:
-            # Assuming the dictionary format is something like {'_UTCDateTime__ns': 1598918401000000000}
-            ns = value.get("_UTCDateTime__ns")
-            if ns is not None:
-                return UTCDateTime(ns / 1e9)  # Convert nanoseconds to seconds
-        except Exception as e:
-            raise UTCDateTimeError() from e
-    else:
-        # Handle other formats (datetime, float, int, str)
-        try:
-            return UTCDateTime(value)
-        except Exception:
-            raise UTCDateTimeError()
-
-    raise UTCDateTimeError()  # Raise an error if none of the above conditions are met
-
-
-# Code below is what was used to parse UTCDateTime value for pydantic before version 109 break.
-# def parse_utcdatetime(
-#     value: Union[datetime, float, int, str, UTCDateTime]
-# ) -> UTCDateTime:
-#     try:
-#         return UTCDateTime(value)
-#     except:
-#         raise UTCDateTimeError()
+    try:
+        return UTCDateTime(value)
+    except:
+        raise UTCDateTimeError()
 
 
 register_custom_pydantic_type(