-
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 mulitple version of cdevents' specifications (#19
) - refactor: move spec into a subfolder and add link to `main` branch of spec - feat!: add support for multiple version of specification of cdevents - link as git submodule several versions of cdevents specs - add version into module name of subject's content - generate a module per specs with alias to the versionned subejct's content module - generate a module `latest` with alias to the latest version of each subject's content module - ignore subject'content with modifier in their version - update tests to load every json schema and test it (selection based on `context.type` - refactor: apply linter's advices - docs: use `spec_0_3_0` in README.md instead of `latest` FIX #16 --------- Signed-off-by: David Bernard <[email protected]>
- Loading branch information
Showing
57 changed files
with
996 additions
and
626 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
[submodule "cdevents-spec"] | ||
path = cdevents-spec | ||
[submodule "cdevents-specs/spec-v0.3"] | ||
path = cdevents-specs/spec-v0.3 | ||
url = https://github.com/cdevents/spec.git | ||
branch = spec-v0.3 | ||
[submodule "cdevents-specs/main"] | ||
path = cdevents-specs/main | ||
url = https://github.com/cdevents/spec.git |
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,41 @@ | ||
// @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 = "description", default, skip_serializing_if = "Option::is_none",)] | ||
pub description: Option<crate::NonEmptyString>, | ||
#[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); | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Submodule spec-v0.3
updated
from 000000 to 2b6379
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
Oops, something went wrong.