X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/69221de9db77ccb68f8d744e5d2dceeef963ae36..096c4dcbbcabbfac7b41f0ebb1a2c52b66341a65:/lib/controller/router/response.go?ds=sidebyside diff --git a/lib/controller/router/response.go b/lib/controller/router/response.go index 8d143cf6c0..6c578e0a14 100644 --- a/lib/controller/router/response.go +++ b/lib/controller/router/response.go @@ -164,7 +164,11 @@ func (rtr *router) mungeItemFields(tmp map[string]interface{}) { if err != nil { break } - tmp[k] = t.Format(rfc3339NanoFixed) + if t.IsZero() { + tmp[k] = nil + } else { + tmp[k] = t.Format(rfc3339NanoFixed) + } } } switch k { @@ -175,17 +179,10 @@ func (rtr *router) mungeItemFields(tmp map[string]interface{}) { // as a first step, we'll just try to return the same that railsapi. In the future, // when railsapi is not used anymore, this could all be changed to return whatever we define // in the specification. - case "output_uuid", "output_name", "log_uuid", "description", "requesting_container_uuid": + case "output_uuid", "output_name", "log_uuid", "description", "requesting_container_uuid", "container_uuid": if v == "" { tmp[k] = nil } - case "expires_at": - // For some reason this case isn't covered by the "case time.Time" above. - // easy to change the code and test it with: - // test lib/controller -gocheck.f TestGetObjects - if tmp[k] == "0001-01-01T00:00:00.000000000Z" { - tmp[k] = nil - } case "container_count_max": if v == float64(0) { tmp[k] = nil