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

[DOCS]: Add an Example of Validating SBOMs #708

Open
saquibsaifee opened this issue Oct 13, 2024 · 2 comments
Open

[DOCS]: Add an Example of Validating SBOMs #708

saquibsaifee opened this issue Oct 13, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@saquibsaifee
Copy link
Contributor

saquibsaifee commented Oct 13, 2024

Create documentation to guide users on validating SBOMs.

The CycloneDX Python library can validate an SBOM based on the schema, independent of the library's support for SBOM serialization, which is a valuable feature. However, the current documentation lacks clear examples and instructions on effectively utilizing this validation functionality.

The following points should be addressed in the documentation:

An overview of how to validate SBOMs based on schema specifications.
Examples demonstrating the validation process, including code snippets using JsonStrictValidator and other relevant classes.

@saquibsaifee saquibsaifee changed the title [DOCS] Add examples of SBOM validation [DOCS]: Add an Example of Validating SBOMs Oct 13, 2024
@jkowalleck
Copy link
Member

examples:

my_json_validator = JsonStrictValidator(SchemaVersion.V1_6)
try:
validation_errors = my_json_validator.validate_str(json_data)
if validation_errors:
print('JSON invalid', 'ValidationError:', repr(validation_errors), sep='\n', file=sys.stderr)
sys.exit(2)
print('JSON valid')
except MissingOptionalDependencyException as error:
print('JSON-validation was skipped due to', error)

@jkowalleck jkowalleck added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Oct 13, 2024
@saquibsaifee
Copy link
Contributor Author

I will be working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants