tools-python icon indicating copy to clipboard operation
tools-python copied to clipboard

json/yaml/xml writer add redundant "Document" property at top level

Open nicoweidner opened this issue 2 years ago • 1 comments

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.

nicoweidner avatar Sep 27 '22 09:09 nicoweidner

relates to #184

meretp avatar Oct 14 '22 10:10 meretp

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.

nicoweidner avatar Nov 02 '22 09:11 nicoweidner

fixed with #254

meretp avatar Nov 07 '22 07:11 meretp