Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid tag:value SPDX file is valid according to tools-java #57

Open
vargenau opened this issue Jan 17, 2024 · 3 comments
Open

Invalid tag:value SPDX file is valid according to tools-java #57

vargenau opened this issue Jan 17, 2024 · 3 comments

Comments

@vargenau
Copy link

bug.spdx.txt

File bug.spdx is invalid according to tools-python:

pyspdxtools -i bug.spdx
ERROR:root:There have been issues while parsing the provided document:
Element Package is not the current element in scope, probably the expected tag to start the element (PackageName) is missing. Line: 32

tools-java does not detect it as invalid

tools-java release 1.1.8

@goneall
Copy link
Member

goneall commented Jan 18, 2024

It looks like the FilesAnalyzed is after the Relationships which is invalid - agree this is a bug.

@vargenau Thanks for reporting it.

I'll transfer the issue to the tag/value parser project which does the parsing and validation.

@goneall goneall transferred this issue from spdx/tools-java Jan 18, 2024
@goneall
Copy link
Member

goneall commented Jan 18, 2024

After researching #58 I've come to the conclusion this is actually valid since the spec does not state what order the relationships and files analyzed flags should be in.

@vargenau - let me know if you agree. If so, it looks like this may be an issue for the tools-python library.

@goneall
Copy link
Member

goneall commented Jan 18, 2024

@vargenau - Never mind - I found the documentation that states the relationships information "may" follow the package information before the file information. It isn't very clear, but you could read this as the ordering is required.

I'll leave this open as a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants