mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Fix and Allow Number and Boolean type to be key in from yaml
(#7607)
Fix and Allow Number and Boolean type to be key in Yaml . For example : `"200 : " | from yaml` not allowed because of Number key type. PR allow , we can use Boolean and Number for key. For example : `"true : false" | from yaml` `"5050 : it is number" | from yaml` Fixes #7222 .
This commit is contained in:
committed by
GitHub
parent
4f812a7f34
commit
568927349d
@ -126,6 +126,18 @@ fn convert_yaml_value_to_nu_value(
|
||||
val_span,
|
||||
);
|
||||
match (k, v) {
|
||||
(serde_yaml::Value::Number(k), _) => {
|
||||
collected.item.insert(
|
||||
k.to_string(),
|
||||
convert_yaml_value_to_nu_value(v, span, val_span)?,
|
||||
);
|
||||
}
|
||||
(serde_yaml::Value::Bool(k), _) => {
|
||||
collected.item.insert(
|
||||
k.to_string(),
|
||||
convert_yaml_value_to_nu_value(v, span, val_span)?,
|
||||
);
|
||||
}
|
||||
(serde_yaml::Value::String(k), _) => {
|
||||
collected.item.insert(
|
||||
k.clone(),
|
||||
|
Reference in New Issue
Block a user