updated json field validator and allow duplicated keys when serializing record models

This commit is contained in:
Gani Georgiev committed 2026-09-06 12:31:52 +03:00
1 parent 57c0b034e6
commit 75c6a4fd1f
10 files changed
+81 -22

No files matched your search

+3 -1
View File
@@ -1333,7 +1333,9 @@ func (m Record) MarshalJSON() ([]byte, error) {
return json.Marshal(
m.PublicExport(),
json.Deterministic(true),
// to preserve the old jsonv1 behavior in case of invalid data
// for compliance with old data (and slightly better performance)
jsontext.AllowDuplicateNames(true),
// preserve the old jsonv1 behavior in case of invalid data
jsontext.AllowInvalidUTF8(true),
)
}