Skip to content

Commit 153270f

Browse files
committed
No validation
1 parent 9c13adb commit 153270f

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

lib/dsc-lib/locales/en-us.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ invalidObjectElement = "Array elements cannot be objects"
386386

387387
[functions.json]
388388
description = "Converts a valid JSON string into a JSON data type"
389-
notString = "Argument must be a string"
390389
invalidJson = "Invalid JSON string"
391390

392391
[functions.lastIndexOf]

lib/dsc-lib/src/functions/json.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ impl Function for Json {
2727
}
2828

2929
fn invoke(&self, args: &[Value], _context: &Context) -> Result<Value, DscError> {
30-
let Some(json_str) = args[0].as_str() else {
31-
return Err(DscError::Parser(t!("functions.json.notString").to_string()));
32-
};
30+
let json_str = args[0].as_str().unwrap();
3331

3432
match serde_json::from_str(json_str) {
3533
Ok(value) => Ok(value),

0 commit comments

Comments
 (0)