Skip to content

Formats JSON string so that Serde can use it

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

gapitio/json_string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Formats a given string so that serde_json crate can understand it.

Example 1

use serial_test::serial;
use json_string::prepare_json_string;

let original_str = r#"
    [
        {"tag":"lol", "groups":[]}
    ]
"#;
let prepared_str = prepare_json_string(original_str);

let expected_str = r#"[{"tag": "lol"}]"#;

assert_eq!(prepared_str, expected_str);

Example 2

use serial_test::serial;
use json_string::prepare_json_string;

let original_str = r#"
    [
        {"label":"lol", "customtags": {"k1": "v1"}}
    ]
"#;
let prepared_str = prepare_json_string(original_str);

let expected_str = r#"[{"label": "lol", "customtags": {"k1": "v1"}}]"#;

assert_eq!(prepared_str, expected_str);

About

Formats JSON string so that Serde can use it

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages