From 4861f02d329b32b41429935edb805e1427ba8afd Mon Sep 17 00:00:00 2001 From: David Bernard Date: Thu, 8 Aug 2024 20:15:00 +0200 Subject: [PATCH] chore: update for latest spec-0.4 Signed-off-by: David Bernard --- cdevents-sdk/src/context.rs | 2 +- cdevents-sdk/tests/specs.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cdevents-sdk/src/context.rs b/cdevents-sdk/src/context.rs index 65cf8a7..1c7e32d 100644 --- a/cdevents-sdk/src/context.rs +++ b/cdevents-sdk/src/context.rs @@ -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, - #[serde(rename = "chain_id", skip_serializing_if = "Option::is_none")] + #[serde(rename = "chainId", skip_serializing_if = "Option::is_none")] pub(crate) chain_id: Option, #[serde(skip_serializing_if = "Option::is_none")] pub(crate) links: Option, diff --git a/cdevents-sdk/tests/specs.rs b/cdevents-sdk/tests/specs.rs index a85f156..e106874 100644 --- a/cdevents-sdk/tests/specs.rs +++ b/cdevents-sdk/tests/specs.rs @@ -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: @@ -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 =