You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/schema.rs
+12-13Lines changed: 12 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,7 @@ use serde::de::{self, Visitor};
3
3
use serde::{Deserialize,Deserializer,Serialize,Serializer};
4
4
/// Package identifies the code library or command that
5
5
/// is potentially affected by a particular vulnerability.
6
-
#[derive(Debug,Serialize,Deserialize)]
7
-
6
+
#[derive(Debug,Serialize,Deserialize,Clone)]
8
7
pubstructPackage{
9
8
/// The name of the package or dependency.
10
9
pubname:String,
@@ -330,7 +329,7 @@ impl<'de> Deserialize<'de> for Ecosystem {
330
329
331
330
/// Type of the affected range supplied. This can be an ecosystem
332
331
/// specific value, semver, or a git commit hash.
333
-
#[derive(Debug,Serialize,Deserialize)]
332
+
#[derive(Debug,Serialize,Deserialize,Clone)]
334
333
#[serde(rename_all = "UPPERCASE")]
335
334
#[non_exhaustive]
336
335
pubenumRangeType{
@@ -350,7 +349,7 @@ pub enum RangeType {
350
349
351
350
/// The event captures information about the how and when
352
351
/// the package was affected by the vulnerability.
353
-
#[derive(Debug,Serialize,Deserialize)]
352
+
#[derive(Debug,Serialize,Deserialize,Clone)]
354
353
#[serde(rename_all = "lowercase")]
355
354
#[non_exhaustive]
356
355
pubenumEvent{
@@ -371,7 +370,7 @@ pub enum Event {
371
370
372
371
/// The range of versions of a package for which
373
372
/// it is affected by the vulnerability.
374
-
#[derive(Debug,Serialize,Deserialize)]
373
+
#[derive(Debug,Serialize,Deserialize,Clone)]
375
374
pubstructRange{
376
375
/// The format that the range events are specified in, for
377
376
/// example SEMVER or GIT.
@@ -393,7 +392,7 @@ pub struct Range {
393
392
/// by a particular vulnerability. The affected ranges can include
394
393
/// when the vulnerability was first introduced and also when it
395
394
/// was fixed.
396
-
#[derive(Debug,Serialize,Deserialize)]
395
+
#[derive(Clone,Debug,Serialize,Deserialize)]
397
396
pubstructAffected{
398
397
/// The package that is affected by the vulnerability
399
398
#[serde(skip_serializing_if = "Option::is_none")]
@@ -433,7 +432,7 @@ pub struct Affected {
433
432
/// The type of reference information that has been provided. Examples include
434
433
/// links to the original report, external advisories, or information about the
435
434
/// fix.
436
-
#[derive(Debug,Serialize,Deserialize)]
435
+
#[derive(Clone,Debug,Serialize,Deserialize)]
437
436
#[serde(rename_all = "UPPERCASE")]
438
437
#[non_exhaustive]
439
438
pubenumReferenceType{
@@ -476,7 +475,7 @@ pub enum ReferenceType {
476
475
}
477
476
478
477
/// Reference to additional information about the vulnerability.
479
-
#[derive(Debug,Serialize,Deserialize)]
478
+
#[derive(Clone,Debug,Serialize,Deserialize)]
480
479
pubstructReference{
481
480
/// The type of reference this URL points to.
482
481
#[serde(rename = "type")]
@@ -489,7 +488,7 @@ pub struct Reference {
489
488
490
489
/// The [`SeverityType`](SeverityType) describes the quantitative scoring method used to rate the
491
490
/// severity of the vulnerability.
492
-
#[derive(Debug,Serialize,Deserialize)]
491
+
#[derive(Clone,Debug,Serialize,Deserialize)]
493
492
#[non_exhaustive]
494
493
pubenumSeverityType{
495
494
/// A CVSS vector string representing the unique characteristics and severity of the vulnerability
@@ -518,7 +517,7 @@ pub enum SeverityType {
518
517
519
518
/// The type and score used to describe the severity of a vulnerability using one
520
519
/// or more quantitative scoring methods.
521
-
#[derive(Debug,Serialize,Deserialize)]
520
+
#[derive(Clone,Debug,Serialize,Deserialize)]
522
521
pubstructSeverity{
523
522
/// The severity type property must be a [`SeverityType`](SeverityType), which describes the
524
523
/// quantitative method used to calculate the associated score.
@@ -534,7 +533,7 @@ pub struct Severity {
534
533
/// the type or role of the individual or entity being credited.
535
534
///
536
535
/// These values and their definitions correspond directly to the [MITRE CVE specification](https://cveproject.github.io/cve-schema/schema/v5.0/docs/#collapseDescription_oneOf_i0_containers_cna_credits_items_type).
537
-
#[derive(Debug,Serialize,Deserialize)]
536
+
#[derive(Clone,Debug,Serialize,Deserialize)]
538
537
#[serde(rename_all = "UPPERCASE")]
539
538
#[non_exhaustive]
540
539
pubenumCreditType{
@@ -573,7 +572,7 @@ pub enum CreditType {
573
572
574
573
/// Provides a way to give credit for the discovery, confirmation, patch or other events in the
575
574
/// life cycle of a vulnerability.
576
-
#[derive(Debug,Serialize,Deserialize)]
575
+
#[derive(Clone,Debug,Serialize,Deserialize)]
577
576
pubstructCredit{
578
577
pubname:String,
579
578
#[serde(skip_serializing_if = "Option::is_none")]
@@ -588,7 +587,7 @@ pub struct Credit {
588
587
/// This is the entity that is returned when vulnerable data exists for
589
588
/// a given package or when requesting information about a specific vulnerability
590
589
/// by unique identifier.
591
-
#[derive(Debug,Serialize,Deserialize)]
590
+
#[derive(Clone,Debug,Serialize,Deserialize)]
592
591
pubstructVulnerability{
593
592
/// The schema_version field is used to indicate which version of the OSV schema a particular
0 commit comments