1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Eq, PartialEq, Hash, Deserialize, Serialize)]
pub enum SbomFormat {
    /// Cyclone DX (JSON)
    ///
    /// See: <https://cyclonedx.org/>
    #[serde(rename = "application/vnd.cyclonedx+json")]
    CycloneDxJson,

    /// SPDX (JSON)
    ///
    /// See: <https://spdx.dev/>
    #[serde(rename = "application/spdx+json")]
    SpdxJson,

    /// Syft (JSON)
    ///
    /// See: <https://github.com/anchore/syft>
    #[serde(rename = "application/vnd.syft+json")]
    SyftJson,
}

/// All currently supported SBOM formats.
pub const SBOM_FORMATS: &[SbomFormat] = &[
    SbomFormat::CycloneDxJson,
    SbomFormat::SpdxJson,
    SbomFormat::SyftJson,
];