forked from mtusi2026/mtusi2026lab4
feat: complete lab4 attachment endpoints, s3 storage and updated_at field
This commit is contained in:
+2
-1
@@ -49,7 +49,8 @@ def validate(value, schema, where='response'):
|
||||
check(value == schema['const'], where + ': invalid const')
|
||||
if isinstance(value,dict):
|
||||
props = schema.get('properties',{})
|
||||
check(all(k in value for k in schema.get('required',[])), where + ': missing required fields')
|
||||
missing = [k for k in schema.get('required',[]) if k not in value]
|
||||
check(not missing, where + ': missing required fields: ' + str(missing))
|
||||
if schema.get('additionalProperties') is False:
|
||||
check(not set(value).difference(props), where + ': unexpected fields')
|
||||
for key, sub in props.items():
|
||||
|
||||
Reference in New Issue
Block a user