diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-11-02 18:19:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-02 18:19:24 +0100 |
commit | e63e90999c88c7e8c9193c98df962e47001adb0f (patch) | |
tree | a60243c69d6febb0f813a609a469014b451d8405 /pkg/api/handlers/utils/handler.go | |
parent | 0d5aef47d3b5322d8d7d876a27ff06b5eb71c97a (diff) | |
parent | d0dfc5e2234a3567addd8163a0bd6a3f03d740cc (diff) | |
download | podman-e63e90999c88c7e8c9193c98df962e47001adb0f.tar.gz podman-e63e90999c88c7e8c9193c98df962e47001adb0f.tar.bz2 podman-e63e90999c88c7e8c9193c98df962e47001adb0f.zip |
Merge pull request #12156 from matejvasek/docker-api-zero-value-fixes
Fix libpod API conformance to swagger
Diffstat (limited to 'pkg/api/handlers/utils/handler.go')
-rw-r--r-- | pkg/api/handlers/utils/handler.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/api/handlers/utils/handler.go b/pkg/api/handlers/utils/handler.go index 29139a98e..96b7a957c 100644 --- a/pkg/api/handlers/utils/handler.go +++ b/pkg/api/handlers/utils/handler.go @@ -145,12 +145,12 @@ func MarshalErrorSliceJSON(ptr unsafe.Pointer, stream *jsoniter.Stream) { } } -func MarshalErrorJSONIsEmpty(_ unsafe.Pointer) bool { - return false +func MarshalErrorJSONIsEmpty(ptr unsafe.Pointer) bool { + return *((*error)(ptr)) == nil } -func MarshalErrorSliceJSONIsEmpty(_ unsafe.Pointer) bool { - return false +func MarshalErrorSliceJSONIsEmpty(ptr unsafe.Pointer) bool { + return len(*((*[]error)(ptr))) <= 0 } // WriteJSON writes an interface value encoded as JSON to w |