CycloneDX / CycloneDX/cyclonedx-rust-cargo

Split `specs` module for XML and JSON

Open
#697 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
178
Forks
66
PR merge metrics
No merged PRs in 30d

Description

While implementing the `formula` type for the XML and JSON schemas. I noticed that the two specs don't actually agree on the structure of some fields: [This](https://github.com/CycloneDX/specification/blob/8e131b1688ccfe41e1bfdd4b3280f33dcc06d04c/schema/bom-1.5.xsd#L1783-L1813) is the XML schema for dependencies and [this](https://github.com/CycloneDX/specification/blob/8e131b1688ccfe41e1bfdd4b3280f33dcc06d04c/schema/bom-1.5.schema.json#L73-L79) is the JSON one. In the former, dependencies are a tree, and the latter, they are a list of unique items.

I'm not sure how those two could be reconciled in the `models` module. But right now `cyclonedx-bom` rejects a valid XML bom if it has a tree of dependencies instead of a proper list. I think the best path here would be to keep separated `specs` modules. One for JSON and another for XML. This could open the door to generating the JSON and XML types for the specs automatically using crates like [typify](https://github.com/oxidecomputer/typify) and the like.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.