-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Failed to load JSON 1.4 format #610
Comments
Why do you think so? The following JSON would be schema invalid:
|
@jkowalleck I get that this is schema invalid, but there are tools (not mine) that create such data. I think that the library should accept "almost" valid docs as they are seen in the wild. If it cannot, then this is mostly useless as not only it cannot process these documents, but also one cannot load them first to diagnose the issue. And this kind of problems forces the users to create pre-processing code to fix things up, not a good thing IMHO and this is a disservice to this library. Note that this issue is mostly the same as #600 : validating the data should be an option and should not be strict all the times. |
Is that so? This library comes with a schema validator. Is it not able to detect this invalid document?
this is not an issue of validating, but the fact that invalid data is not expected to work in no way. There is just no defined way to "load" invalid data. You could argue to have behavior A, others could argue to have behavior B - when there is just no correct behavior for this case in the first place. PS: see https://cyclonedx-python-library.readthedocs.io/en/latest/examples.html#complex-deserialize for an example of deserialization after successful validation. |
So basically some CDX will not be loadable by this library short of writing an external wrapper. |
A license was found in some CDX 1.4 doc with this data:
"licenses":[{}]
This makes the validation fail and the doc does not load.
This is another example where we should be able to load the document, normalize and report a warning but not fail entirely.
NB: this is a document produced by some proprietary tool that I do not control.
@tomd ping
The text was updated successfully, but these errors were encountered: