mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
Add json_schema_extra to openapi.json (#5930)
Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
This commit is contained in:
@@ -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,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user