Skip to content

Commit 674d41c

Browse files
committed
Allow resource and extension manifests to have metadata property
1 parent f7e6e82 commit 674d41c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/dsc-lib/src/dscresources/resource_manifest.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rust_i18n::t;
55
use schemars::{Schema, JsonSchema, json_schema};
66
use semver::Version;
77
use serde::{Deserialize, Serialize};
8-
use serde_json::Value;
8+
use serde_json::{Map, Value};
99
use std::collections::HashMap;
1010

1111
use crate::{dscerror::DscError, schemas::DscRepoSchema};
@@ -71,6 +71,8 @@ pub struct ResourceManifest {
7171
/// Details how to get the schema of the resource.
7272
#[serde(skip_serializing_if = "Option::is_none")]
7373
pub schema: Option<SchemaKind>,
74+
#[serde(skip_serializing_if = "Option::is_none")]
75+
pub metadata: Option<Map<String, Value>>,
7476
}
7577

7678
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)]

lib/dsc-lib/src/extensions/extension_manifest.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rust_i18n::t;
55
use schemars::{Schema, JsonSchema, json_schema};
66
use semver::Version;
77
use serde::{Deserialize, Serialize};
8-
use serde_json::Value;
8+
use serde_json::{Map, Value};
99
use std::collections::HashMap;
1010

1111
use crate::{dscerror::DscError, schemas::DscRepoSchema};
@@ -36,6 +36,8 @@ pub struct ExtensionManifest {
3636
/// Mapping of exit codes to descriptions. Zero is always success and non-zero is always failure.
3737
#[serde(rename = "exitCodes", skip_serializing_if = "Option::is_none")]
3838
pub exit_codes: Option<HashMap<i32, String>>,
39+
#[serde(skip_serializing_if = "Option::is_none")]
40+
pub metadata: Option<Map<String, Value>>,
3941
}
4042

4143
impl DscRepoSchema for ExtensionManifest {

0 commit comments

Comments
 (0)