feat: complete lab4 attachment endpoints, s3 storage and updated_at field

This commit is contained in:
2026-11-11 21:11:47 +03:00
parent b815cef838
commit 95466a864a
7 changed files with 135 additions and 223 deletions
+2 -1
View File
@@ -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():