From ac4573bca8afa8f2e4c0d4d6242480830deeb281 Mon Sep 17 00:00:00 2001 From: "Daniel G. Taylor" Date: Fri, 3 Nov 2023 08:56:19 -0700 Subject: [PATCH] fix: better comparison of encoded payloads for patch, fixes #73 --- autopatch/autopatch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autopatch/autopatch.go b/autopatch/autopatch.go index 505b23c7..c6a88d50 100644 --- a/autopatch/autopatch.go +++ b/autopatch/autopatch.go @@ -277,7 +277,7 @@ func PatchResource(api huma.API, path *huma.PathItem) { return } - if bytes.Equal(bytes.TrimSpace(patched), bytes.TrimSpace(origWriter.Body.Bytes())) { + if jsonpatch.Equal(patched, origWriter.Body.Bytes()) { ctx.SetStatus(http.StatusNotModified) return }