Fix network prune api docs

The api doc used wrong response examples for both the compat and libpod
network prune endpoints. Change the doc so that it matches the actual
return values. Also fix the endpoints to return an empty array instead
of null when no networks are removed.

[NO TESTS NEEDED]

Fixes: #10564

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2021-06-08 10:55:02 +02:00
parent 9a3a7327fd
commit 8378a9c4df
5 changed files with 17 additions and 11 deletions

View File

@ -190,5 +190,8 @@ func Prune(w http.ResponseWriter, r *http.Request) {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, err)
return
}
if pruneReports == nil {
pruneReports = []*entities.NetworkPruneReport{}
}
utils.WriteResponse(w, http.StatusOK, pruneReports)
}