OpenAPI Validation Fixes
OpenAPI validation seems to have become stricter about checking for None defaults in parameters that don't allow None. I have modified two things as a result: 1. StageTypeProperty (used to pick between SangaStage and SangaDeltaStage) now defaults to SangaStage (which is the original behaviour anyway) 2. It is now allowed to pass x,y,z=None when making a move - this is the same as not passing the respective argument, so the function already correctly handled this case.
This commit is contained in:
parent
4b73fd82f6
commit
1f558bbeb7
4 changed files with 5 additions and 6 deletions
|
|
@ -10,9 +10,9 @@ class MoveStageAPI(ActionView):
|
|||
load_default=False,
|
||||
metadata={"description": "Move to an absolute position", "example": 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),
|
||||
"x": fields.Int(load_default=None, metadata={"example": 100}, allow_none=True),
|
||||
"y": fields.Int(load_default=None, metadata={"example": 100}, allow_none=True),
|
||||
"z": fields.Int(load_default=None, metadata={"example": 20}, allow_none=True),
|
||||
}
|
||||
|
||||
def post(self, args):
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ class StageTypeProperty(PropertyView):
|
|||
"""The type of the stage"""
|
||||
|
||||
schema = fields.String(
|
||||
load_default=None,
|
||||
load_default="SangaStage",
|
||||
validate=validate.OneOf(["SangaStage", "SangaDeltaStage"]),
|
||||
metadata={
|
||||
"description": "The translation stage geometry",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue