Skip to content

Commit 98c3443

Browse files
Update customize_schema.py
1 parent 9bb732d commit 98c3443

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

caltechdata_api/customize_schema.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,15 @@ def validate_metadata(json_record):
504504
for creator in json_record["creators"]:
505505
if not isinstance(creator, dict):
506506
errors.append("Each 'creator' must be a dictionry")
507-
if "nameType" in creator:
508-
if creator["nameType"] != "Organizational":
507+
if "nameType" in creator:
508+
if creator["nameType"] == "Organizational":
509+
if "name" not in creator:
510+
errors.append("Each organizational 'creator' must have 'name'.")
511+
else:
509512
if "familyName" not in creator:
510-
errors.append("Each 'creator' must have a 'familyName' or have type 'Organizational'.")
513+
errors.append(
514+
"Each 'creator' must have a 'familyName' or have type Organizational"
515+
)
511516
if "affiliation" in creator:
512517
if not isinstance(creator["affiliation"], list):
513518
errors.append("'affiliation' in 'creators' should be a list.")

0 commit comments

Comments
 (0)