diff --git a/greenbone/scap/cpe_match/json.py b/greenbone/scap/cpe_match/json.py index 32024df..1e4813e 100644 --- a/greenbone/scap/cpe_match/json.py +++ b/greenbone/scap/cpe_match/json.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later import gzip -from dataclasses import asdict, dataclass +from dataclasses import asdict, dataclass, field from datetime import datetime from pathlib import Path from typing import Any, Optional, Sequence, TextIO @@ -49,10 +49,10 @@ class MatchStringResponse: start_index: int total_results: int timestamp: datetime - match_strings: list[MatchStringItem] format: str = "NVD_CPEMatchString" version: str = "2.0" + match_strings: list[MatchStringItem] = field(default_factory=list) class MatchStringJsonManager(JsonManager): diff --git a/greenbone/scap/data_utils/json.py b/greenbone/scap/data_utils/json.py index d0575bb..36f1318 100644 --- a/greenbone/scap/data_utils/json.py +++ b/greenbone/scap/data_utils/json.py @@ -41,7 +41,7 @@ def convert_keys_to_camel(obj: Any) -> Any: """ if isinstance(obj, dict): - old_keys = set(obj.keys()) + old_keys = list(obj.keys()) for old_key in old_keys: v = obj[old_key] convert_keys_to_camel(v)