-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for cdevents 0.4 (#24)
- feat: add support for cdevents 0.4 - with some hack, shortcut to improve - chore: update cdevents-sdk/src/generated - chore: update spec 0.4 to 0.4.1 - docs: fix spelling & typo - chore: update for latest spec-0.4 - test: update dependencies and related code --------- Signed-off-by: David Bernard <[email protected]>
- Loading branch information
Showing
54 changed files
with
3,217 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// @generated | ||
// by cdevents/sdk-rust/generator (subject.hbs) | ||
|
||
#[cfg(feature = "testkit")] use proptest_derive::Arbitrary; | ||
use serde::{Serialize, Deserialize}; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Content { | ||
#[serde(rename = "user", default, skip_serializing_if = "Option::is_none",)] | ||
pub user: Option<crate::NonEmptyString>, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use proptest::prelude::*; | ||
use super::*; | ||
|
||
proptest! { | ||
#[test] | ||
#[cfg(feature = "testkit")] | ||
fn arbitraries_are_json_valid(s in any::<Content>()) { | ||
let json_str = serde_json::to_string(&s).unwrap(); | ||
let actual = serde_json::from_str::<Content>(&json_str).unwrap(); | ||
assert_eq!(s, actual); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// @generated | ||
// by cdevents/sdk-rust/generator (subject.hbs) | ||
|
||
#[cfg(feature = "testkit")] use proptest_derive::Arbitrary; | ||
use serde::{Serialize, Deserialize}; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Content { | ||
#[serde(rename = "user", default, skip_serializing_if = "Option::is_none",)] | ||
pub user: Option<crate::NonEmptyString>, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use proptest::prelude::*; | ||
use super::*; | ||
|
||
proptest! { | ||
#[test] | ||
#[cfg(feature = "testkit")] | ||
fn arbitraries_are_json_valid(s in any::<Content>()) { | ||
let json_str = serde_json::to_string(&s).unwrap(); | ||
let actual = serde_json::from_str::<Content>(&json_str).unwrap(); | ||
assert_eq!(s, actual); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// @generated | ||
// by cdevents/sdk-rust/generator (subject.hbs) | ||
|
||
#[cfg(feature = "testkit")] use proptest_derive::Arbitrary; | ||
use serde::{Serialize, Deserialize}; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Content { | ||
#[serde(rename = "change",)] | ||
pub change: ContentChange, | ||
#[serde(rename = "sbom", default, skip_serializing_if = "Option::is_none",)] | ||
pub sbom: Option<ContentSbom>, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct ContentSbom { | ||
#[serde(rename = "uri",)] | ||
pub uri: crate::UriReference, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct ContentChange { | ||
#[serde(rename = "id",)] | ||
pub id: crate::Id, | ||
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)] | ||
pub source: Option<crate::UriReference>, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use proptest::prelude::*; | ||
use super::*; | ||
|
||
proptest! { | ||
#[test] | ||
#[cfg(feature = "testkit")] | ||
fn arbitraries_are_json_valid(s in any::<Content>()) { | ||
let json_str = serde_json::to_string(&s).unwrap(); | ||
let actual = serde_json::from_str::<Content>(&json_str).unwrap(); | ||
assert_eq!(s, actual); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// @generated | ||
// by cdevents/sdk-rust/generator (subject.hbs) | ||
|
||
#[cfg(feature = "testkit")] use proptest_derive::Arbitrary; | ||
use serde::{Serialize, Deserialize}; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Content { | ||
#[serde(rename = "sbom", default, skip_serializing_if = "Option::is_none",)] | ||
pub sbom: Option<ContentSbom>, | ||
#[serde(rename = "user", default, skip_serializing_if = "Option::is_none",)] | ||
pub user: Option<crate::NonEmptyString>, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct ContentSbom { | ||
#[serde(rename = "uri",)] | ||
pub uri: crate::UriReference, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use proptest::prelude::*; | ||
use super::*; | ||
|
||
proptest! { | ||
#[test] | ||
#[cfg(feature = "testkit")] | ||
fn arbitraries_are_json_valid(s in any::<Content>()) { | ||
let json_str = serde_json::to_string(&s).unwrap(); | ||
let actual = serde_json::from_str::<Content>(&json_str).unwrap(); | ||
assert_eq!(s, actual); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// @generated | ||
// by cdevents/sdk-rust/generator (subject.hbs) | ||
|
||
#[cfg(feature = "testkit")] use proptest_derive::Arbitrary; | ||
use serde::{Serialize, Deserialize}; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Content { | ||
#[serde(rename = "signature",)] | ||
pub signature: crate::NonEmptyString, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use proptest::prelude::*; | ||
use super::*; | ||
|
||
proptest! { | ||
#[test] | ||
#[cfg(feature = "testkit")] | ||
fn arbitraries_are_json_valid(s in any::<Content>()) { | ||
let json_str = serde_json::to_string(&s).unwrap(); | ||
let actual = serde_json::from_str::<Content>(&json_str).unwrap(); | ||
assert_eq!(s, actual); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// @generated | ||
// by cdevents/sdk-rust/generator (subject.hbs) | ||
|
||
#[cfg(feature = "testkit")] use proptest_derive::Arbitrary; | ||
use serde::{Serialize, Deserialize}; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Content { | ||
#[serde(rename = "repository", default, skip_serializing_if = "Option::is_none",)] | ||
pub repository: Option<ContentRepository>, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct ContentRepository { | ||
#[serde(rename = "id",)] | ||
pub id: crate::Id, | ||
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)] | ||
pub source: Option<crate::UriReference>, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use proptest::prelude::*; | ||
use super::*; | ||
|
||
proptest! { | ||
#[test] | ||
#[cfg(feature = "testkit")] | ||
fn arbitraries_are_json_valid(s in any::<Content>()) { | ||
let json_str = serde_json::to_string(&s).unwrap(); | ||
let actual = serde_json::from_str::<Content>(&json_str).unwrap(); | ||
assert_eq!(s, actual); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// @generated | ||
// by cdevents/sdk-rust/generator (subject.hbs) | ||
|
||
#[cfg(feature = "testkit")] use proptest_derive::Arbitrary; | ||
use serde::{Serialize, Deserialize}; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Content { | ||
#[serde(rename = "repository", default, skip_serializing_if = "Option::is_none",)] | ||
pub repository: Option<ContentRepository>, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct ContentRepository { | ||
#[serde(rename = "id",)] | ||
pub id: crate::Id, | ||
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)] | ||
pub source: Option<crate::UriReference>, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use proptest::prelude::*; | ||
use super::*; | ||
|
||
proptest! { | ||
#[test] | ||
#[cfg(feature = "testkit")] | ||
fn arbitraries_are_json_valid(s in any::<Content>()) { | ||
let json_str = serde_json::to_string(&s).unwrap(); | ||
let actual = serde_json::from_str::<Content>(&json_str).unwrap(); | ||
assert_eq!(s, actual); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// @generated | ||
// by cdevents/sdk-rust/generator (subject.hbs) | ||
|
||
#[cfg(feature = "testkit")] use proptest_derive::Arbitrary; | ||
use serde::{Serialize, Deserialize}; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Content { | ||
#[serde(rename = "artifactId", default, skip_serializing_if = "Option::is_none",)] | ||
pub artifact_id: Option<String>, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use proptest::prelude::*; | ||
use super::*; | ||
|
||
proptest! { | ||
#[test] | ||
#[cfg(feature = "testkit")] | ||
fn arbitraries_are_json_valid(s in any::<Content>()) { | ||
let json_str = serde_json::to_string(&s).unwrap(); | ||
let actual = serde_json::from_str::<Content>(&json_str).unwrap(); | ||
assert_eq!(s, actual); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// @generated | ||
// by cdevents/sdk-rust/generator (subject.hbs) | ||
|
||
#[cfg(feature = "testkit")] use proptest_derive::Arbitrary; | ||
use serde::{Serialize, Deserialize}; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
#[cfg_attr(feature = "testkit", derive(Arbitrary))] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Content { | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use proptest::prelude::*; | ||
use super::*; | ||
|
||
proptest! { | ||
#[test] | ||
#[cfg(feature = "testkit")] | ||
fn arbitraries_are_json_valid(s in any::<Content>()) { | ||
let json_str = serde_json::to_string(&s).unwrap(); | ||
let actual = serde_json::from_str::<Content>(&json_str).unwrap(); | ||
assert_eq!(s, actual); | ||
} | ||
} | ||
} |
Oops, something went wrong.