Added description schema
This commit is contained in:
parent
7f9a89814c
commit
71d942477a
@ -1 +1,2 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
from .description_schema import DescriptionSchema
|
||||||
|
9
storage_service/schemas/description_schema.py
Normal file
9
storage_service/schemas/description_schema.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
from marshmallow import Schema, fields, RAISE
|
||||||
|
from marshmallow.validate import Regexp, Length
|
||||||
|
|
||||||
|
|
||||||
|
class DescriptionSchema(Schema):
|
||||||
|
tag = fields.Str(required=True, validate=[Regexp("^[a-zA-Z]+[0-9a-zA-Z_]*$"), Length(min=2, max=32)])
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
unknown = RAISE # Later this could be changed to EXCLUDE to maintain compatibility among versions
|
Loading…
Reference in New Issue
Block a user