More Marshmallow argument updates
This commit is contained in:
parent
e22f36b308
commit
9dbb083ee7
18 changed files with 102 additions and 87 deletions
|
|
@ -10,8 +10,8 @@ from openflexure_microscope.api.v2.views.captures import CaptureSchema
|
|||
|
||||
|
||||
class CaptureResizeSchema(Schema):
|
||||
width = fields.Integer(example=640, required=True)
|
||||
height = fields.Integer(example=480, required=True)
|
||||
width = fields.Integer(metadata={"example":640}, required=True)
|
||||
height = fields.Integer(metadata={"example": 480}, required=True)
|
||||
|
||||
|
||||
class BasicCaptureArgs(Schema):
|
||||
|
|
@ -23,10 +23,10 @@ class BasicCaptureArgs(Schema):
|
|||
|
||||
|
||||
class FullCaptureArgs(BasicCaptureArgs):
|
||||
filename = fields.String(example="MyFileName")
|
||||
filename = fields.String(metadata={"example": "MyFileName"})
|
||||
temporary = fields.Boolean(load_default=False, metadata={"description": "Delete capture on shutdown"})
|
||||
annotations = fields.Dict(load_default={}, example={"Client": "SwaggerUI"})
|
||||
tags = fields.List(fields.String, load_default=[], example=["docs"])
|
||||
annotations = fields.Dict(load_default={}, metadata={"example": {"Client": "SwaggerUI"}})
|
||||
tags = fields.List(fields.String, load_default=[], metadata={"example": ["docs"]})
|
||||
|
||||
|
||||
class CaptureAPI(ActionView):
|
||||
|
|
@ -113,7 +113,7 @@ class GPUPreviewStartAPI(ActionView):
|
|||
in the format ``[x, y, width, height]``.
|
||||
"""
|
||||
|
||||
args = {"window": fields.List(fields.Integer, load_default=[], example=[0, 0, 640, 480])}
|
||||
args = {"window": fields.List(fields.Integer, load_default=[], metadata={"example": [0, 0, 640, 480]})}
|
||||
|
||||
def post(self, args):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ from labthings.views import ActionView
|
|||
class MoveStageAPI(ActionView):
|
||||
args = {
|
||||
"absolute": fields.Boolean(
|
||||
load_default=False, example=False, metadata={"description": "Move to an absolute position"}
|
||||
load_default=False, metadata={"description": "Move to an absolute position", "example": False}
|
||||
),
|
||||
"x": fields.Int(load_default=None, example=100, allow_none=False),
|
||||
"y": fields.Int(load_default=None, example=100, allow_none=False),
|
||||
"z": fields.Int(load_default=None, example=20, allow_none=False),
|
||||
"x": fields.Int(load_default=None, metadata={"example": 100}, allow_none=False),
|
||||
"y": fields.Int(load_default=None, metadata={"example": 100}, allow_none=False),
|
||||
"z": fields.Int(load_default=None, metadata={"example": 20}, allow_none=False),
|
||||
}
|
||||
|
||||
def post(self, args):
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class InstrumentSchema(Schema):
|
|||
|
||||
class ImageSchema(Schema):
|
||||
id = fields.UUID()
|
||||
time = fields.String(format="date")
|
||||
time = fields.String(metadata={"format": "date"})
|
||||
format = fields.String()
|
||||
name = fields.String()
|
||||
tags = fields.List(fields.String())
|
||||
|
|
|
|||
|
|
@ -8,9 +8,8 @@ class StageTypeProperty(PropertyView):
|
|||
|
||||
schema = fields.String(
|
||||
load_default=None,
|
||||
example="SangaStage",
|
||||
validate=validate.OneOf(["SangaStage", "SangaDeltaStage"]),
|
||||
metadata={"description": "The translation stage geometry"},
|
||||
metadata={"description": "The translation stage geometry", "example": "SangaStage",},
|
||||
allow_none=False,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue