(experimental) upgraded to encoding/json/v2

This commit is contained in:
Gani Georgiev committed 2026-08-18 18:16:22 +03:00
1 parent 4d4275c9aa
commit 97dd775455
125 files changed
+433 -364

No files matched your search

+6 -4
View File
@@ -3,7 +3,7 @@ package tests
import (
"bytes"
"context"
"encoding/json"
"encoding/json/jsontext"
"fmt"
"io"
"maps"
@@ -259,14 +259,16 @@ func (scenario *ApiScenario) test(t testing.TB) {
}
} else {
// normalize json response format
buffer := new(bytes.Buffer)
err := json.Compact(buffer, recorder.Body.Bytes())
var normalizedBody string
buf := new(bytes.Buffer)
enc := jsontext.NewEncoder(buf)
err := enc.WriteValue(recorder.Body.Bytes())
if err != nil {
// not a json...
normalizedBody = recorder.Body.String()
} else {
normalizedBody = buffer.String()
normalizedBody = buf.String()
}
for _, item := range scenario.ExpectedContent {