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

[BUG] OrganizationalEntity validation error should not be raised #600

Closed
pombredanne opened this issue Apr 26, 2024 · 3 comments · Fixed by #611
Closed

[BUG] OrganizationalEntity validation error should not be raised #600

pombredanne opened this issue Apr 26, 2024 · 3 comments · Fixed by #611
Labels
bug Something isn't working

Comments

@pombredanne
Copy link

pombredanne commented Apr 26, 2024

A spec-valid JSON BOM 1.4 with {"supplier":{"name":""}, fails to load and should not fail.

The code at

if not name and not urls and not contacts:
makes loading a BOM that has a name as an empty string to fail.

There is nothing in the spec that says this is invalid... I can accept that there is a way to do a strict validation, but this should be an option AND this should not make it impossible to load a JSON. If this cannot be loaded, fixing the issue is made much harder.

The spec at https://github.com/CycloneDX/specification/blob/1.6/schema/bom-1.4.schema.json#L203 does not have any such requirements, same in https://cyclonedx.org/docs/1.4/xml/#type_organizationalEntity and other versions of the spec.

IMHO such as exception here and elsewhere SHOULD NEVER be raised unless an explicit request for a strict validation for empty values is requested above and beyond what is in the spec.

@tdruez ping

@jkowalleck jkowalleck added the bug Something isn't working label Apr 26, 2024
@jkowalleck jkowalleck changed the title OrganizationalEntity validation error should not be raised [BUG] OrganizationalEntity validation error should not be raised Apr 26, 2024
@pombredanne
Copy link
Author

pombredanne commented Apr 26, 2024

@jkowalleck FYI, this is the kind of workaround that is needed short term to read CDX from some weird tool that produce these documents:

nexB/scancode.io@1bd0e4d#diff-ea7df675af2b46146067bf4d4314ece949da068c9ae5635fa423c19f008209b3R211

@jkowalleck
Copy link
Member

@pombredanne
Copy link
Author

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants