CycloneDX / cyclonedx-rust-cargo

Creates CycloneDX Software Bill of Materials (SBOM) from Rust (Cargo) projects
https://cyclonedx.org/
Apache License 2.0
106 stars 44 forks source link

Split `specs` module for XML and JSON #697

Open pvdrz opened 6 months ago

pvdrz commented 6 months ago

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 is the XML schema for dependencies and this 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 and the like.