Skip to content

Commit

Permalink
chore: update for latest spec-0.4
Browse files Browse the repository at this point in the history
Signed-off-by: David Bernard <[email protected]>
  • Loading branch information
davidB committed Aug 8, 2024
1 parent 40028d2 commit 4861f02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cdevents-sdk/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(crate) struct Context {
pub(crate) timestamp: time::OffsetDateTime,
#[serde(rename = "schemaUri", skip_serializing_if = "Option::is_none")]
pub(crate) schema_uri: Option<Uri>,
#[serde(rename = "chain_id", skip_serializing_if = "Option::is_none")]
#[serde(rename = "chainId", skip_serializing_if = "Option::is_none")]
pub(crate) chain_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) links: Option<serde_json::Value>,
Expand Down
4 changes: 2 additions & 2 deletions cdevents-sdk/tests/specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn events_schemas() -> &'static EventsSchemas {
}

#[rstest]
fn can_serde_example(#[files("../cdevents-specs/spec-*/examples/*.json")] path: PathBuf) {
fn can_serde_example(#[files("../cdevents-specs/spec-*/examples/*.json")] #[files("../cdevents-specs/spec-*/conformance/*.json")] path: PathBuf) {
let example_txt = fs::read_to_string(path).expect("to read file as string");
// HACK uri are stored ad http::Uri, they are "normalized" when serialized, so prenormalization to avoid failure like
// json atoms at path ".subject.content.repository.source" are not equal:
Expand All @@ -102,7 +102,7 @@ fn can_serde_example(#[files("../cdevents-specs/spec-*/examples/*.json")] path:
}

#[rstest]
fn validate_example_against_schema(#[files("../cdevents-specs/spec-*/examples/*.json")] path: PathBuf) {
fn validate_example_against_schema(#[files("../cdevents-specs/spec-*/examples/*.json")] #[files("../cdevents-specs/spec-*/conformance/*.json")] path: PathBuf) {
let events_schemas = events_schemas();
let example_txt = fs::read_to_string(path).expect("to read file as string");
let example_json: serde_json::Value =
Expand Down

0 comments on commit 4861f02

Please sign in to comment.