diff --git a/openflexure_microscope/api/app.py b/openflexure_microscope/api/app.py index 205e9333..c27bc90d 100644 --- a/openflexure_microscope/api/app.py +++ b/openflexure_microscope/api/app.py @@ -106,7 +106,7 @@ app, labthing = create_app( cors: CORS = CORS(app) # Enable correct handling of Marshmallow/Webargs validation errors -# Return validation errors as JSON +# Return validation errors as JSON # (see https://webargs.readthedocs.io/en/latest/framework_support.html) @app.errorhandler(422) @app.errorhandler(400) @@ -118,6 +118,7 @@ def handle_error(err): else: return jsonify({"errors": messages}), err.code + # Use custom JSON encoder labthing.json_encoder = JSONEncoder app.json_encoder = JSONEncoder diff --git a/openflexure_microscope/api/default_extensions/scan.py b/openflexure_microscope/api/default_extensions/scan.py index e05f7352..782ad8f4 100644 --- a/openflexure_microscope/api/default_extensions/scan.py +++ b/openflexure_microscope/api/default_extensions/scan.py @@ -362,7 +362,11 @@ class ScanExtension(BaseExtension): class TileScanArgs(FullCaptureArgs): namemode = fields.String(missing="coordinates", example="coordinates") - grid = fields.List(fields.Integer(validate=marshmallow.validate.Range(min=1)), missing=[3, 3, 3], example=[3, 3, 3], ) + grid = fields.List( + fields.Integer(validate=marshmallow.validate.Range(min=1)), + missing=[3, 3, 3], + example=[3, 3, 3], + ) style = fields.String(missing="raster") autofocus_dz = fields.Integer(missing=50) fast_autofocus = fields.Boolean(missing=False)