summaryrefslogtreecommitdiffstats
path: root/openbb_platform/core/openbb_core/provider/standard_models/moody.py
diff options
context:
space:
mode:
Diffstat (limited to 'openbb_platform/core/openbb_core/provider/standard_models/moody.py')
-rw-r--r--openbb_platform/core/openbb_core/provider/standard_models/moody.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/openbb_platform/core/openbb_core/provider/standard_models/moody.py b/openbb_platform/core/openbb_core/provider/standard_models/moody.py
index 7504b7cb35d..0eddca2096f 100644
--- a/openbb_platform/core/openbb_core/provider/standard_models/moody.py
+++ b/openbb_platform/core/openbb_core/provider/standard_models/moody.py
@@ -5,7 +5,7 @@ from datetime import (
)
from typing import Literal, Optional
-from pydantic import Field
+from pydantic import Field, field_validator
from openbb_core.provider.abstract.data import Data
from openbb_core.provider.abstract.query_params import QueryParams
@@ -31,6 +31,12 @@ class MoodyCorporateBondIndexQueryParams(QueryParams):
description="The type of series.",
)
+ @field_validator("index_type", mode="before", check_fields=False)
+ @classmethod
+ def to_lower(cls, v: Optional[str]) -> Optional[str]:
+ """Convert field to lowercase."""
+ return v.lower() if v else v
+
class MoodyCorporateBondIndexData(Data):
"""Moody Corporate Bond Index Data."""