# README
[<img alt="crates.io" src="https://img.shields.io/crates/v/jsonerr2array.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/jsonerr2array)
[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-jsonerr2array-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" height="20">](https://docs.rs/jsonerr2array)
[<img alt="github" src="https://img.shields.io/badge/git-jsonerr2array-8da0cb?style=for-the-badge&labelColor=555555&logo=git" height="20">](https://codeberg.org/AlbanMinassian/errorjson)
[jsonerr2array](https://crates.io/crates/jsonerr2array) help to transform jsonerr to array json
## Usage
```rust
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
```json
[
{
"meta": {},
"iserr": true,
"err": {
"code": "ERR001",
"message": "message",
"payload": { "payload" : 1 }
}
},
{
"meta": {},
"iserr": true,
"err": {
"code": "ERR002",
"message": "message",
"payload": { "payload" : 2 }
}
}
]
```
## Examples
- `cargo run --example basic`