From f611256d90afe6d07450d0dfd5c3d830402fc6bd Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sun, 6 Sep 2026 16:24:36 +0300 Subject: [PATCH] removed manual unescape as jsonv2 does it alreadyfor us --- plugins/migratecmd/templates.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/plugins/migratecmd/templates.go b/plugins/migratecmd/templates.go index b135529b..179817af 100644 --- a/plugins/migratecmd/templates.go +++ b/plugins/migratecmd/templates.go @@ -8,7 +8,6 @@ import ( "fmt" "path/filepath" "slices" - "strconv" "strings" "github.com/pocketbase/pocketbase/core" @@ -667,22 +666,11 @@ func init() { } func marhshalWithoutEscape(v any, prefix string, indent string) ([]byte, error) { - raw, err := json.Marshal(v, - json.Deterministic(true), + return json.Marshal(v, jsontext.WithIndentPrefix(prefix), jsontext.WithIndent(indent), + json.Deterministic(true), ) - if err != nil { - return nil, err - } - - // unescape escaped unicode characters - unescaped, err := strconv.Unquote(strings.ReplaceAll(strconv.Quote(string(raw)), `\\u`, `\u`)) - if err != nil { - return nil, err - } - - return []byte(unescaped), nil } func escapeBacktick(v string) string {