Converting valid JSON SPDX file to tag:value gives invalid SPDX
bug.spdx.jsonis valid:
pyspdxtools -i bug.spdx.json
Convert to tag:value:
pyspdxtools -i bug.spdx.json -o bug.spdx
Result is invalid:
pyspdxtools -i bug.spdx
ERROR:root:There have been issues while parsing the provided document:
Error while parsing Package: ['Error while parsing PackageSourceInfo: Token did not match specified grammar rule. Line: 24']
tools-python release 0.8.2
Thanks for the bug report! This bug is caused by the package source info which is "NOASSERTION" in the JSON file. When translating this to tag-value the string is deserialized and also serialized as NOASSERTION. This string is handled as a special word and gets a dedicated token by the tag-value parser. As NOASSERTION is no valid value for the package source info but a string is, this incosistency appears. For fields where noassertion is not explicitly allowed but a string is we ~should probably not serialize/deserialize the string into the NoAssertion object but keep it as a string in the internal data model. Also, the tag-value parser~ (edit: is already the case) should to be less strict in this case and accept NOASSERTION as a string, I'll work on a fix for this.