Update delete action behavior and JSON format output (#1155)

This PR changes delete behavior:

* On success, a 204 is returned rather than a 200 with an empty JSON object
* The CLI now passes through the 404 error if encountered instead of swallowing it

It also updates formatting for JSON to use the response body, which means that the item (or items) in the JSON format are actually the format across the wire, instead of being reinterpreted by unmarshaling into the Go SDK and then remarshaling.
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2021-04-26 20:38:55 -04:00
1 parent 93d8115775
commit 4690225c1e
60 files changed
+283 -474

No files matched your search

@@ -214,13 +214,13 @@ func (c *PasswordCommand) Run(args []string) int {
switch c.Func {
}
item := result.GetItem().(*accounts.Account)
switch base.Format(c.UI) {
case "table":
item := result.GetItem().(*accounts.Account)
c.UI.Output(printItemTable(item))
case "json":
if ok := c.PrintJsonItem(result, item); !ok {
if ok := c.PrintJsonItem(result); !ok {
return base.CommandCliError
}
}