From e447a76965f0c9ad080e36b6659a73b8832682ca Mon Sep 17 00:00:00 2001 From: mimir-d Date: Sat, 12 Oct 2024 16:21:44 +0100 Subject: [PATCH] fix spec violations found by the validator - File object had a badly named field - remove an extension example entry; see #22 for details Signed-off-by: mimir-d --- .github/workflows/test.yaml | 2 +- examples/extensions.rs | 10 ++++------ src/spec.rs | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f938a08..9cf0f88 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -93,4 +93,4 @@ jobs: cargo run --manifest-path $ROOT/Cargo.toml --example {} | tee /dev/stderr | go run . -schema ../../json_spec/output/root.json - - " \ No newline at end of file + " diff --git a/examples/extensions.rs b/examples/extensions.rs index f78886f..4a377fe 100644 --- a/examples/extensions.rs +++ b/examples/extensions.rs @@ -16,7 +16,7 @@ enum ExtensionType { } #[derive(Serialize)] -struct ComplexExtension { +struct Extension { #[serde(rename = "@type")] ext_type: ExtensionType, @@ -25,13 +25,11 @@ struct ComplexExtension { } async fn step0(s: tv::ScopedTestStep) -> Result { - s.add_extension("simple", "extension_identifier").await?; - s.add_extension( - "complex", - ComplexExtension { + "ext0", + Extension { ext_type: ExtensionType::Example, - field: "demo".to_owned(), + field: "example".to_owned(), subtypes: vec![1, 42], }, ) diff --git a/src/spec.rs b/src/spec.rs index a0cb26a..f61e9dc 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -875,7 +875,7 @@ pub struct Diagnosis { #[derive(Debug, Serialize, PartialEq, Clone)] #[serde(rename = "file")] pub struct File { - #[serde(rename = "name")] + #[serde(rename = "displayName")] pub name: String, #[serde(rename = "uri")]