-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Description
Object Keys when printed are always printed in the sorted order. the order should be given as defined before in the object.
Steps to Reproduce
- The following code to be included in the main.rs
use jslt::Jslt;
use serde_json::json;
use std::fs;
fn main() -> Result<(), Box <dyn std::error::Error> > {
let jslt: Jslt = r#"
let val = {"d": 100, "c": 200,"a":1, "b":32}
to-json($val)
"#.parse()?;
let input = json!({
"data": [
[1, 2, 3, 4, 5],
[6, 7, 8, 9, 10]
]
});
let output = jslt.transform_value(&input)?;
println!("{}",output);
assert_eq!( "\"{\\\"d\\\":100,\\\"c\\\":200,\\\"a\\\":1,\\\"b\\\":32}\"",output.to_string());
Ok(())
}
Actual Output
{"a":1,"b":32,"c":200,"d":100}
Expected Output
{"d":100,"c":200,"a":1,"b":32}
Environment
Nightly Rust Toolchain
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels