Crates.io | jsonerr2array |
lib.rs | jsonerr2array |
version | 0.0.2 |
source | src |
created_at | 2023-06-18 19:17:07.702703 |
updated_at | 2023-06-19 07:08:48.964446 |
description | jsonerr to array |
homepage | https://codeberg.org/AlbanMinassian/errorjson |
repository | https://codeberg.org/AlbanMinassian/errorjson |
max_upload_size | |
id | 893601 |
size | 12,303 |
jsonerr2array help to transform jsonerr to array json
use jsonerr2array::*;
fn main() {
let result = jsonerr2array(&serde_json::json!({
"meta": {},
"iserr": true,
"err": {
"code": "ERR001",
"message": "message",
"payload": { "payload" : 1 },
"origin": {
"meta": {},
"iserr": true,
"err": {
"code": "ERR002",
"message": "message",
"payload": { "payload" : 2 }
}
}
}
}));
println!("{:#?}", myjson);
}
return
[
{
"meta": {},
"iserr": true,
"err": {
"code": "ERR001",
"message": "message",
"payload": { "payload" : 1 }
}
},
{
"meta": {},
"iserr": true,
"err": {
"code": "ERR002",
"message": "message",
"payload": { "payload" : 2 }
}
}
]
cargo run --example basic