chore(cli): gracefull failback if API format changes
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
parent
df98df7394
commit
37e9ccec56
|
@ -545,11 +545,27 @@ async fn print_response_entries(response: reqwest::Response, format: OutputForma
|
||||||
entries.for_each(|(_, entry)| {
|
entries.for_each(|(_, entry)| {
|
||||||
println!(
|
println!(
|
||||||
"{}\t{}\t{}\t{}\t{}",
|
"{}\t{}\t{}\t{}\t{}",
|
||||||
entry.get("entity").and_then(|e| e.as_str()).unwrap(),
|
entry
|
||||||
entry.get("attribute").and_then(|a| a.as_str()).unwrap(),
|
.get("entity")
|
||||||
entry.get("value").and_then(|v| v.get("c")).unwrap(),
|
.and_then(|e| e.as_str())
|
||||||
entry.get("timestamp").and_then(|t| t.as_str()).unwrap(),
|
.unwrap_or("???"),
|
||||||
entry.get("provenance").and_then(|p| p.as_str()).unwrap(),
|
entry
|
||||||
|
.get("attribute")
|
||||||
|
.and_then(|a| a.as_str())
|
||||||
|
.unwrap_or("???"),
|
||||||
|
entry
|
||||||
|
.get("value")
|
||||||
|
.and_then(|v| v.get("c"))
|
||||||
|
.map(|c| format!("{c}"))
|
||||||
|
.unwrap_or("???".to_string()),
|
||||||
|
entry
|
||||||
|
.get("timestamp")
|
||||||
|
.and_then(|t| t.as_str())
|
||||||
|
.unwrap_or("???"),
|
||||||
|
entry
|
||||||
|
.get("provenance")
|
||||||
|
.and_then(|p| p.as_str())
|
||||||
|
.unwrap_or("???"),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue