Пример #1
0
class BookSchema(BaseSchema):
    """Example Book schema."""
    title = fields.String(required=True)
    date = fields.Date()
    author = fields.Nested(PersonSchema, required=True)
Пример #2
0
class PersonSchema(BaseSchema):
    """Example Person schema."""
    name = fields.String(required=True)
    birth_date = fields.Date()
    email = fields.Email()