tools-python
tools-python copied to clipboard
json/yaml/xml writer add redundant "Document" property at top level
The writer for json/yaml/xml writes documents like the following, wrapping all content in a redundant Document
property at top level:
{
"Document": {
"spdxVersion": "SPDX-2.1",
"documentNamespace": "https://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301",
<...>
Apart from being redundant, this is incompatible with e.g. the java spdx library, and it is also incompatible with the json spec.
Note: I feel I have seen this issue before, but I couldn't find it now.
relates to #184
Comment: In the case of xml, there needs to be a root element, see https://www.w3schools.com/xml/xml_syntax.asp. But for json and yaml, this is not required.
fixed with #254