Added description schema

This commit is contained in:
Pünkösd Marcell 2020-03-25 04:02:13 +01:00
parent 7f9a89814c
commit 71d942477a
2 changed files with 10 additions and 0 deletions

View File

@ -1 +1,2 @@
#!/usr/bin/env python3
from .description_schema import DescriptionSchema

View 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