Skip to content

Commit 6eafd15

Browse files
committed
Fix json_normalize
1 parent 1d1c1ff commit 6eafd15

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cyclonedx/model/tool.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from json import loads as json_loads
12
from typing import Any, Dict, Iterable, Iterator, List, Optional, Type, Union
23
from xml.etree.ElementTree import Element # nosec B405
34

@@ -232,15 +233,15 @@ def json_normalize(cls, o: ToolRepository, *,
232233
return None
233234

234235
if o._tools: # pylint: disable=protected-access
235-
return [Tool.as_json(t) for t in o] # type: ignore[attr-defined]
236+
return [json_loads(Tool.as_json(t)) for t in o] # type: ignore[attr-defined]
236237

237238
result = {}
238239

239240
if o.components:
240-
result['components'] = [Component.as_json(c) for c in o.components] # type: ignore[attr-defined]
241+
result['components'] = [json_loads(Component.as_json(c)) for c in o.components] # type: ignore[attr-defined]
241242

242243
if o.services:
243-
result['services'] = [Service.as_json(s) for s in o.services] # type: ignore[attr-defined]
244+
result['services'] = [json_loads(Service.as_json(s)) for s in o.services] # type: ignore[attr-defined]
244245

245246
return result
246247

0 commit comments

Comments
 (0)