Hydra API can return list[str] for boostVersion

This commit is contained in:
Mustafa Gezen 2023-06-24 20:33:00 +02:00
parent 9648bfba93
commit ac0e814810
Signed by untrusted user who does not match committer: mustafa
GPG Key ID: DCDF010D946438C1

View File

@ -87,7 +87,7 @@ class Advisory(JSONWizard):
portal_child_ids: list[str] = None
portal_product_filter: list[str] = None
boostProduct: str = None
boostVersion: int = None
boostVersion: int | list[str] = None
detectedProducts: list[str] = None
caseCount: int = None
caseCount_365: int = None
@ -208,4 +208,5 @@ class API:
raise Exception((await response.text()))
elif body.get("response", {}).get("numFound", 0) == 0:
return []
return Advisory.from_list(list(body["response"]["docs"]))
advisory_list = list(body["response"]["docs"])
return Advisory.from_list(advisory_list)