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 c254463
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
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 c254463

Please sign in to comment.