Skip to main content

osv_db/types/
affected.rs

1use serde::Deserialize;
2use serde_json::Value;
3
4use crate::types::{Package, Range, Severity};
5
6/// A single affected package entry.
7#[derive(Debug, Clone, Deserialize)]
8pub struct Affected {
9    /// The affected package identity.
10    pub package: Option<Package>,
11    /// Package-level severity (only valid when the root-level severity is absent).
12    #[serde(default)]
13    pub severity: Vec<Severity>,
14    /// Version ranges within which the package is affected.
15    #[serde(default)]
16    pub ranges: Vec<Range>,
17    /// Explicit list of affected version strings.
18    #[serde(default)]
19    pub versions: Vec<String>,
20    /// Ecosystem-specific additional data.
21    pub ecosystem_specific: Option<Value>,
22    /// Database-specific additional data.
23    pub database_specific: Option<Value>,
24}