Skip to content

Commit b21bde0

Browse files
committed
Fix Echo resource to have correct type for object
1 parent 1f6adbb commit b21bde0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

resources/dscecho/src/echo.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use schemars::JsonSchema;
55
use serde::{Deserialize, Serialize};
6-
use serde_json::Value;
6+
use serde_json::{Map, Value};
77

88
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)]
99
#[serde(untagged)]
@@ -22,7 +22,7 @@ pub enum Output {
2222
String(String),
2323
// Object has to be last so it doesn't get matched first
2424
#[serde(rename = "object")]
25-
Object(Value),
25+
Object(Map<String,Value>),
2626
}
2727

2828
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)]
@@ -36,7 +36,7 @@ pub struct SecureString {
3636
#[serde(deny_unknown_fields)]
3737
pub struct SecureObject {
3838
#[serde(rename = "secureObject")]
39-
pub secure_object: Value,
39+
pub secure_object: Map<String,Value>,
4040
}
4141

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

resources/dscecho/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn main() {
4040
}
4141
},
4242
Output::Object(ref mut obj) => {
43-
*obj = redact(obj);
43+
*obj = redact(&Value::Object(obj.clone())).as_object().unwrap().clone();
4444
},
4545
_ => {}
4646
}

0 commit comments

Comments
 (0)