From 1c27c6e67c0b76137517b1a3530aa7f8874f2a80 Mon Sep 17 00:00:00 2001 From: MartinBelthle Date: Tue, 24 Sep 2024 13:21:57 +0200 Subject: [PATCH] style(api): change apidoc example to make it work (#2155) [ANT-1993] --- antarest/study/business/general_management.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/antarest/study/business/general_management.py b/antarest/study/business/general_management.py index 53e1b9a2ed..088f8708fe 100644 --- a/antarest/study/business/general_management.py +++ b/antarest/study/business/general_management.py @@ -87,6 +87,32 @@ class GeneralFormFields(FormFieldsBaseModel): geographic_trimming: StrictBool thematic_trimming: StrictBool + model_config = { + "json_schema_extra": { + "examples": [ + { + "mode": "Economy", + "first_day": 1, + "last_day": 365, + "horizon": "2020", + "first_month": "january", + "first_week_day": "Monday", + "first_january": "Monday", + "leap_year": True, + "nb_years": 5, + "building_mode": "Automatic", + "selection_mode": True, + "year_by_year": True, + "simulation_synthesis": True, + "mc_scenario": True, + "filtering": True, + "geographic_trimming": True, + "thematic_trimming": True, + } + ] + } + } + @model_validator(mode="before") def day_fields_validation(cls, values: Union[Dict[str, Any], ValidationInfo]) -> Dict[str, Any]: new_values = values if isinstance(values, dict) else values.data