Skip to content

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

Closed

Description

@nicoweidner

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.

Activity

  1. meretp commented on Oct 14, 2022

    @meretp
    Collaborator

    relates to #184

  2. nicoweidner commented on Nov 2, 2022

    @nicoweidner
    CollaboratorAuthor

    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.

  3. meretp commented on Nov 7, 2022

    @meretp
    Collaborator

    fixed with #254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    writerIssues concerning the writing layer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions