add schemas

This commit is contained in:
Torma Kristóf 2021-11-11 16:27:19 +01:00
parent b92ac6b19f
commit 58c8708467
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
2 changed files with 29 additions and 5 deletions

0
src/resources.py Normal file
View File

View File

@ -14,12 +14,36 @@ __module_name__ = "schemas"
__version__text__ = "1" __version__text__ = "1"
class SampleSchema(ma.Schema): class ServiceSchema(ma.Schema):
""" """
Parameters: Parameters:
- date (date) - location (ipv4)
- device_id (int) - zone (string)
""" """
date = fields.DateTime(required=True) location = fields.IPv4(required=True)
device_id = fields.Integer(required=True) zone = fields.String(required=True)
class ServiceDirectorySchema(ma.Schema):
"""
Parameters:
- name (string)
- id (uuid)
"""
name = fields.String(required=True)
id = fields.UUID(required=True)
class ServiceLocatorSchema(ma.Schema):
"""
Parameters:
- name (string)
- id (uuid)
- servicearray (object)
"""
name = fields.String(required=True)
id = fields.UUID(required=True)
servicearray = fields.Nested(ServiceSchema, many=True, required=True)