Skip to content

Commit

Permalink
Fix schema
Browse files Browse the repository at this point in the history
  • Loading branch information
msm-code committed Jan 31, 2024
1 parent 6f50b7f commit 83da249
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mwdb/schema/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class AttributeValueSchema(Schema):

@validates("value")
def validate_value(self, value):
if not value:
# Currently only truthy values and False are allowed as values
if bool(value) or value is False:
raise ValidationError("Value shouldn't be empty")


Expand Down
2 changes: 1 addition & 1 deletion mwdb/schema/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ObjectCreateRequestSchemaBase(Schema):
attributes = fields.Nested(AttributeItemRequestSchema, many=True, missing=[])
upload_as = fields.Str(missing="*", allow_none=False)
karton_id = fields.UUID(missing=None)
karton_arguments = fields.Dict(missing={}, keys=fields.Str(), values=fields.Str())
karton_arguments = fields.Dict(missing={}, keys=fields.Str())
tags = fields.Nested(TagRequestSchema, many=True, missing=[])
share_3rd_party = fields.Boolean(missing=True)

Expand Down

0 comments on commit 83da249

Please sign in to comment.