-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Return line that fail validate #221
Comments
@DavidLambertCyber I noticed that if you explicitly specify the CycloneDX schema version (i.e. use the --input-version argument), you get more detailed error messages. In your case:
Probably one would need to first figure out the schema version and not just try to validate against all versions: cyclonedx-cli/src/cyclonedx/Commands/ValidateCommand.cs Lines 103 to 121 in 5de8d19
|
In addition, here one should also return the result.InstanceLocation, not only the result.SchemaLocation:
but also include |
Improve JSON validation, in particular if you don't specify the specification version. This helps to address #221. On the given example, it will result in: ``` cyclonedx.exe validate --input-file badType_log4j_2.17.2_cyclonedx_1.3_sbom.json Validation failed: Value is "boolean" but should be "string" #/properties/dependencies/items/$ref/properties/ref/type On instance: #/dependencies/0/ref: True Unable to validate against any JSON schemas. BOM is not valid. ``` Signed-off-by: andreas hilti <[email protected]> Co-authored-by: Michael Tsfoni <[email protected]>
This should be improved in release 0.26.0. |
Requesting enhancement to return the line/s that failed validation for json/xml.
The text was updated successfully, but these errors were encountered: