Expand description
OpenVEX 0.2.0 schema types.
Hand-rolled from the OpenVEX 0.2.0 spec
(https://github.com/openvex/spec/blob/main/OPENVEX-SPEC.md) and
cross-checked against the Go reference implementation
(https://github.com/openvex/go-vex/tree/main/pkg/vex). The serde
representation must match the spec verbatim; the vexctl merge
step in our e2e suite is what catches drift.
Field-level notes:
@context/@iduse serde renames because JSON-LD requires the literal@-prefixed keys.- Optional fields use
Option<T>+skip_serializing_if = "Option::is_none"so the emitted JSON omits them rather than emittingnull. Matches the Go implementation’somitemptybehavior. versionis the OpenVEX document revision counter (integer, starts at 1). NOT the schema version.Vec<Statement>is always present (the spec allows it to be empty in principle, but our generator errors out before that state).Product.identifiers/Product.hashes(and same onSubcomponent) useBTreeMapinstead ofHashMapfor deterministic key ordering — easier diffing across runs.
Structs§
- Document
- Top-level OpenVEX document.
- Product
- A product the statement applies to.
@idis a PURL or any URI; the subcomponent list pinpoints the vulnerable transitive dep. - Statement
- One VEX statement — the unit of “I am asserting that vulnerability X has status S relative to product P”.
- Subcomponent
- A subcomponent of the product — i.e. the actual vulnerable dependency the patch covers.
- Vulnerability
- Vulnerability identifier.
nameis the primary ID (we use the GHSA),aliasesholds the CVE list.
Enums§
- Justification
- VEX
justificationenum — only required whenstatus = not_affected. Spec lists five canonical values; we expose them all even thoughsocket-patchonly emitsInlineMitigationsAlreadyExisttoday. - Status
- VEX status. Spec defines exactly these four values.