required datas in json of wb lite, error 422

This commit is contained in:
Cayo Puigdefabregas 2022-04-25 17:20:54 +02:00
parent 515dad5850
commit e818feeebd
1 changed files with 6 additions and 6 deletions

View File

@ -7,11 +7,11 @@ from ereuse_devicehub.resources.schemas import Thing
class Snapshot_lite_data(MarshmallowSchema): class Snapshot_lite_data(MarshmallowSchema):
dmidecode = String(required=False) dmidecode = String(required=True)
hwinfo = String(required=False) hwinfo = String(required=True)
smart = List(Dict(), required=False) smart = List(Dict(), required=True)
lshw = Dict(required=False) lshw = Dict(required=True)
lspci = String(required=False) lspci = String(required=True)
class Snapshot_lite(Thing): class Snapshot_lite(Thing):
@ -22,7 +22,7 @@ class Snapshot_lite(Thing):
sid = String(required=True) sid = String(required=True)
type = String(required=True) type = String(required=True)
timestamp = String(required=True) timestamp = String(required=True)
data = Nested(Snapshot_lite_data) data = Nested(Snapshot_lite_data, required=True)
@validates_schema @validates_schema
def validate_workbench_version(self, data: dict): def validate_workbench_version(self, data: dict):