Skip to content

Commit

Permalink
Merge pull request #51 from ctron/feature/published_1
Browse files Browse the repository at this point in the history
fix: the published field is optional
  • Loading branch information
gcmurphy authored Nov 16, 2024
2 parents 100e05c + 58b32ed commit 2534d2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ mod tests {

#[tokio::test]
async fn test_get_missing_cve() {
let res = vulnerability("CVE-2014-0160").await;
let res = vulnerability("CVE-2014-0161").await;
assert!(res.is_err());
}
}
4 changes: 2 additions & 2 deletions src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ pub struct Vulnerability {

/// The published field gives the time the entry should be considered to have been published,
/// as an RFC3339-formatted time stamp in UTC (ending in “Z”).
pub published: DateTime<Utc>,
pub published: Option<DateTime<Utc>>,

/// The modified field gives the time the entry was last modified, as an RFC3339-formatted
/// timestamptime stamp in UTC (ending in “Z”).
Expand Down Expand Up @@ -621,7 +621,7 @@ mod tests {
let vuln = Vulnerability {
schema_version: Some("1.3.0".to_string()),
id: "OSV-2020-484".to_string(),
published: chrono::Utc::now(),
published: Some(chrono::Utc::now()),
modified: chrono::Utc::now(),
withdrawn: None,
aliases: None,
Expand Down

0 comments on commit 2534d2a

Please sign in to comment.