You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# CLI and validation
- Added --validate and --validate-file flags in Cyclonedx::BomBuilder.
- After writing the BOM, if --validate is set, validate JSON via JSON Schema and XML via XSD with local files under spec/specification-1.7/schema.
- Added logic to validate an existing file with --validate --validate-file <path>, inferring format from extension unless --format is provided.</path>
- In validate-only mode, project path isn’t required.
# Validation helpers
- Added Cyclonedx::BomHelpers.validate_bom_content(content, format, spec_version) which:
- For JSON: uses json_schemer to validate against bom-<ver>.schema.json.</ver>
- For XML: uses Nokogiri::XML::Schema with bom-<ver>.xsd.</ver>
- Uses local schemas at spec/specification-1.7/schema and surfaces compact error messages; returns non-zero exit on failure.
# Dependencies
- Added json_schemer (~> 2.2) to cyclonedx-ruby.gemspec.
- Required json_schemer in lib/cyclonedx/ruby.rb.
# Cucumber tests
- Updated features/help.feature to show the new flags.
- Added features/validate.feature:
- Validate XML BOM succeeds.
- Validate JSON BOM succeeds.
- Validate fails for invalid XML BOM (corrupts namespace and expects exit 1).
# Small extras
- Infer format from file extension when using --validate-file and no --format provided.
Signed-off-by: Peter H. Boling <[email protected]>
0 commit comments