diff --git a/openbb_platform/core/openbb_core/app/provider_interface.py b/openbb_platform/core/openbb_core/app/provider_interface.py index 6c9a558161a..8eb2f5371b6 100644 --- a/openbb_platform/core/openbb_core/app/provider_interface.py +++ b/openbb_platform/core/openbb_core/app/provider_interface.py @@ -15,7 +15,7 @@ from typing import ( Union, ) -from fastapi import Query +from fastapi import Body, Query from pydantic import ( BaseModel, ConfigDict, @@ -290,6 +290,23 @@ class ProviderInterface(metaclass=SingletonMeta): else: default = field.default + if ( + hasattr(annotation, "__name__") + and annotation.__name__ in ["Dict", "dict", "Data"] # type: ignore + or field.kw_only is True + ): + return DataclassField( + new_name, + annotation, + Body( + default=default, + title=provider_name, + description=description, + alias=field.alias or None, + json_schema_extra=getattr(field, "json_schema_extra", None), + ), + ) + if query: # We need to use query if we want the field description to show # up in the swagger, it's a fastapi limitation