From 4381b4fb117306a771cdf33eabb17ccf32f093d8 Mon Sep 17 00:00:00 2001 From: Matthias Veit Date: Wed, 16 Oct 2024 18:04:13 +0200 Subject: [PATCH] [core][fix] Export property documentation for configs (#2245) --- fixcore/fixcore/core_config.py | 2 +- fixcore/fixcore/report/report_config.py | 2 +- fixcore/fixcore/user/__init__.py | 2 +- fixlib/fixlib/config.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fixcore/fixcore/core_config.py b/fixcore/fixcore/core_config.py index b7e59fd04a..9da6e746b8 100644 --- a/fixcore/fixcore/core_config.py +++ b/fixcore/fixcore/core_config.py @@ -673,7 +673,7 @@ class EditableConfig(ConfigObject): def config_model() -> List[Json]: config_classes = {EditableConfig, CustomCommandsConfig} - return dataclasses_to_fixcore_model(config_classes) + return dataclasses_to_fixcore_model(config_classes, with_prop_description=True) # Define rules to validate this config diff --git a/fixcore/fixcore/report/report_config.py b/fixcore/fixcore/report/report_config.py index 1c9a80ef4c..aa37af8045 100644 --- a/fixcore/fixcore/report/report_config.py +++ b/fixcore/fixcore/report/report_config.py @@ -157,4 +157,4 @@ def check_allowed(self, check_id: str) -> bool: def config_model() -> List[Json]: config_classes = {ReportCheckCollectionConfig, BenchmarkConfig, ReportConfig} - return dataclasses_to_fixcore_model(config_classes, use_optional_as_required=True) + return dataclasses_to_fixcore_model(config_classes, use_optional_as_required=True, with_prop_description=True) diff --git a/fixcore/fixcore/user/__init__.py b/fixcore/fixcore/user/__init__.py index ae3b751454..b9fd3dbae0 100644 --- a/fixcore/fixcore/user/__init__.py +++ b/fixcore/fixcore/user/__init__.py @@ -113,4 +113,4 @@ async def users(self) -> Dict[Email, FixInventoryUser]: def config_model() -> List[Json]: config_classes: Set[Type[Any]] = {FixInventoryUsersConfig} - return dataclasses_to_fixcore_model(config_classes, use_optional_as_required=True) + return dataclasses_to_fixcore_model(config_classes, use_optional_as_required=True, with_prop_description=True) diff --git a/fixlib/fixlib/config.py b/fixlib/fixlib/config.py index a47911460a..f0d3c6570e 100644 --- a/fixlib/fixlib/config.py +++ b/fixlib/fixlib/config.py @@ -377,7 +377,7 @@ def __eq__(self, other: Any) -> bool: def model(self) -> List[Json]: """Return the config dataclass model in fixcore format""" classes = set(_config.classes.values()) - return dataclasses_to_fixcore_model(classes, use_optional_as_required=True) + return dataclasses_to_fixcore_model(classes, use_optional_as_required=True, with_prop_description=True) @staticmethod def add_args(arg_parser: ArgumentParser) -> None: