Skip to content

Commit

Permalink
Remove identifiers requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
tmorrell committed Dec 2, 2024
1 parent e80296e commit cb69fa5
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions caltechdata_api/customize_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,12 @@ def validate_metadata(json_record):

# Check for 'identifiers'
if "identifiers" in json_record:
if not isinstance(json_record["identifiers"], list):
errors.append("'identifiers' should be a list.")

if (
not isinstance(json_record["identifiers"], list)
or len(json_record["identifiers"]) == 0
):
errors.append("'identifiers' should be a non-empty list.")
else:
for identifier in json_record["identifiers"]:
if (
Expand Down Expand Up @@ -490,25 +494,6 @@ def validate_metadata(json_record):
):
errors.append("Each 'date' must have 'date' and 'dateType'.")

# Check for 'identifiers'
if "identifiers" not in json_record:
errors.append("'identifiers' field is missing.")
elif (
not isinstance(json_record["identifiers"], list)
or len(json_record["identifiers"]) == 0
):
errors.append("'identifiers' should be a non-empty list.")
else:
for identifier in json_record["identifiers"]:
if (
not isinstance(identifier, dict)
or "identifier" not in identifier
or "identifierType" not in identifier
):
errors.append(
"Each 'identifier' must have 'identifier' and 'identifierType'."
)

# Check for 'creators'
if "creators" not in json_record:
errors.append("'creators' field is missing.")
Expand Down

0 comments on commit cb69fa5

Please sign in to comment.