Skip to content

Commit

Permalink
fixing test issue, adding references only if result is a dict
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazztok45 committed Nov 12, 2024
1 parent f654dc5 commit ad3ede4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/zbmath_rest2oai/getAsXml.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ def api_doc_endpoint(page):
break
list_articles_ids_to_soft.extend([entry["id"] for entry in data["result"]])
page+=1
json["result"]["references"] = list_articles_ids_to_soft

if isinstance(json["result"], dict):
json["result"]["references"] = list_articles_ids_to_soft
# Wrap it in a list to make it iterable for your existing loop
json["result"] = [json["result"]]

Expand Down

0 comments on commit ad3ede4

Please sign in to comment.