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

This commit is contained in:
Gani Georgiev
2026-09-06 12:31:52 +03:00
parent 57c0b034e6
commit 75c6a4fd1f
10 changed files with 81 additions and 22 deletions
+10
View File
@@ -101,6 +101,16 @@ func TestJSONFieldValidateValue(t *testing.T) {
},
true,
},
{
"invalid raw value (v2 semantics)",
&core.JSONField{Name: "test"},
func() *core.Record {
record := core.NewRecord(collection)
record.SetRaw("test", types.JSONRaw(`{"a": 1, "a": 2}`))
return record
},
true,
},
{
"zero field value (not required)",
&core.JSONField{Name: "test"},