From ab6ccd429ab4185f229a0c73866bdf60d21a36ef Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Thu, 24 Jul 2025 18:37:34 +0100 Subject: [PATCH] Fix DataSchema return for background detector status --- src/openflexure_microscope_server/background_detect.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openflexure_microscope_server/background_detect.py b/src/openflexure_microscope_server/background_detect.py index d57b7c6b..eb1297a8 100644 --- a/src/openflexure_microscope_server/background_detect.py +++ b/src/openflexure_microscope_server/background_detect.py @@ -30,6 +30,9 @@ class BackgroundDetectorStatus(BaseModel): """ settings: BaseModel """The settings for this this background detect Algorithm""" + + # Setting schema is a dict until LabThings FastAPI issue #154 is fixed and + # DataSchema can be used. settings_schema: dict[str, Any] @@ -56,7 +59,7 @@ class BackgroundDetectAlgorithm: return BackgroundDetectorStatus( ready=self.background_data is not None, settings=self.settings, - settings_schema=type_to_dataschema(self.settings_data_model), + settings_schema=type_to_dataschema(self.settings_data_model).model_dump(), ) # Requires a getter and a setter to support being a BaseModel but being