Skip to content

Commit

Permalink
fix spec violations found by the validator
Browse files Browse the repository at this point in the history
- File object had a badly named field
- remove an extension example entry; see #22 for details

Signed-off-by: mimir-d <[email protected]>
  • Loading branch information
mimir-d committed Oct 12, 2024
1 parent 52e3314 commit e447a76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ jobs:
cargo run --manifest-path $ROOT/Cargo.toml --example {} |
tee /dev/stderr |
go run . -schema ../../json_spec/output/root.json -
"
"
10 changes: 4 additions & 6 deletions examples/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum ExtensionType {
}

#[derive(Serialize)]
struct ComplexExtension {
struct Extension {
#[serde(rename = "@type")]
ext_type: ExtensionType,

Expand All @@ -25,13 +25,11 @@ struct ComplexExtension {
}

async fn step0(s: tv::ScopedTestStep) -> Result<TestStatus, tv::OcptvError> {
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],
},
)
Expand Down
2 changes: 1 addition & 1 deletion src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit e447a76

Please sign in to comment.