diff options
author | Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> | 2024-01-08 23:08:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-08 22:08:24 +0000 |
commit | af8dbe452b32a4fa710b3baa4a2fa2a168a4234f (patch) | |
tree | ddd26e272440dfedd5875d2b74e7c0e2cd007529 | |
parent | bae33881d2dc17bc0acfa1b33132e0ab73413baa (diff) |
Add json_schema_extra to openapi.json (#5930)
Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
-rw-r--r-- | openbb_platform/core/openbb_core/app/provider_interface.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/openbb_platform/core/openbb_core/app/provider_interface.py b/openbb_platform/core/openbb_core/app/provider_interface.py index 59ce12edb4f..d60a235f50d 100644 --- a/openbb_platform/core/openbb_core/app/provider_interface.py +++ b/openbb_platform/core/openbb_core/app/provider_interface.py @@ -245,6 +245,7 @@ class ProviderInterface(metaclass=SingletonMeta): title=provider_name, description=description, alias=field.alias or None, + json_schema_extra=field.json_schema_extra, ) elif provider_name: default: FieldInfo = Field( @@ -257,6 +258,7 @@ class ProviderInterface(metaclass=SingletonMeta): ) if alias_dict.get(name, []) else None, + json_schema_extra=field.json_schema_extra, ) return DataclassField(new_name, type_, default) @@ -479,6 +481,7 @@ class ProviderInterface(metaclass=SingletonMeta): fields.update(extra.model_fields) fields_dict: Dict[str, Tuple[Any, Any]] = {} + for name, field in fields.items(): fields_dict[name] = ( field.annotation, @@ -488,6 +491,7 @@ class ProviderInterface(metaclass=SingletonMeta): description=field.description, alias=field.alias, validation_alias=field.validation_alias, + json_schema_extra=field.json_schema_extra, ), ) |