Skip to content

Don't crash on duplicated filetypes #630

@bmihaila-bd

Description

@bmihaila-bd

Some SBOM creation tools create fileTypes entries which might contain duplicates, e.g.

"fileTypes": [
                "SOURCE",
                "TEXT",
                "SOURCE",
            ],

The MR #310 added code for supporting multiple fileTypes but the code is too strict in that it does not allow duplicates. It throws a raise CardinalityError("File::FileType") in case of dupes. The spec does not forbid this https://spdx.github.io/spdx-spec/v2.2.2/file-information/#83-file-type-field so the parser should not be that strict and crash on such files. I see a similar behavior for licenseInfoInFiles which do not raise an exception on duplicates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions