Skip to content

Commit 9b1343e

Browse files
committed
address Tess' feedback to rename properties to be more clear
1 parent 7a0a907 commit 9b1343e

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

dsc_lib/src/discovery/command_discovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ fn load_extension_manifest(path: &Path, manifest: &ExtensionManifest) -> Result<
744744
description: manifest.description.clone(),
745745
version: manifest.version.clone(),
746746
capabilities,
747-
import_extensions,
747+
import_file_extensions: import_extensions,
748748
path: path.to_str().unwrap().to_string(),
749749
directory: path.parent().unwrap().to_str().unwrap().to_string(),
750750
manifest: serde_json::to_value(manifest)?,

dsc_lib/src/extensions/dscextension.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ pub struct DscExtension {
2424
/// The capabilities of the resource.
2525
pub capabilities: Vec<Capability>,
2626
/// The extensions supported for importing.
27-
pub import_extensions: Option<Vec<String>>,
27+
#[serde(rename = "importFileExtensions")]
28+
pub import_file_extensions: Option<Vec<String>>,
2829
/// The file path to the resource.
2930
pub path: String,
3031
/// The description of the resource.
@@ -65,7 +66,7 @@ impl DscExtension {
6566
type_name: String::new(),
6667
version: String::new(),
6768
capabilities: Vec::new(),
68-
import_extensions: None,
69+
import_file_extensions: None,
6970
description: None,
7071
path: String::new(),
7172
directory: String::new(),
@@ -153,7 +154,7 @@ impl DscExtension {
153154
if self.capabilities.contains(&Capability::Import) {
154155
let file_path = Path::new(file);
155156
let file_extension = file_path.extension().and_then(|s| s.to_str()).unwrap_or_default().to_string();
156-
if self.import_extensions.as_ref().is_some_and(|exts| exts.contains(&file_extension)) {
157+
if self.import_file_extensions.as_ref().is_some_and(|exts| exts.contains(&file_extension)) {
157158
debug!("{}", t!("extensions.dscextension.importingFile", file = file, extension = self.type_name));
158159
} else {
159160
debug!("{}", t!("extensions.dscextension.importNotSupported", file = file, extension = self.type_name));

dsc_lib/src/extensions/import.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use serde::{Deserialize, Serialize};
77
#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize, JsonSchema)]
88
pub struct ImportMethod {
99
/// The extensions to import.
10-
pub extensions: Vec<String>,
10+
#[serde(rename = "fileExtensions")]
11+
pub file_extensions: Vec<String>,
1112
/// The command to run to get the state of the resource.
1213
pub executable: String,
1314
/// The arguments to pass to the command to perform an Import.

extensions/bicep/bicep.dsc.extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.1.0",
55
"description": "Enable passing Bicep file directly to DSC, but requires bicep executable to be available.",
66
"import": {
7-
"extensions": ["bicep"],
7+
"fileExtensions": ["bicep"],
88
"executable": "bicep",
99
"args": [
1010
"build",

0 commit comments

Comments
 (0)