Skip to content

Commit

Permalink
Add json_schema_extra to openapi.json (#5930)
Browse files Browse the repository at this point in the history
Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
  • Loading branch information
IgorWounds and deeleeramone authored Jan 8, 2024
1 parent bae3388 commit af8dbe4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openbb_platform/core/openbb_core/app/provider_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ def _create_field(
title=provider_name,
description=description,
alias=field.alias or None,
json_schema_extra=field.json_schema_extra,
)
elif provider_name:
default: FieldInfo = Field(
Expand All @@ -257,6 +258,7 @@ def _create_field(
)
if alias_dict.get(name, [])
else None,
json_schema_extra=field.json_schema_extra,
)

return DataclassField(new_name, type_, default)
Expand Down Expand Up @@ -479,6 +481,7 @@ def _generate_return_schema(
fields.update(extra.model_fields)

fields_dict: Dict[str, Tuple[Any, Any]] = {}

for name, field in fields.items():
fields_dict[name] = (
field.annotation,
Expand All @@ -488,6 +491,7 @@ def _generate_return_schema(
description=field.description,
alias=field.alias,
validation_alias=field.validation_alias,
json_schema_extra=field.json_schema_extra,
),
)

Expand Down

0 comments on commit af8dbe4

Please sign in to comment.