diff --git a/internal/json/json.go b/internal/json/json.go index 69ae573c09..2cb1caf187 100644 --- a/internal/json/json.go +++ b/internal/json/json.go @@ -12,14 +12,18 @@ import ( ) var ( + config = sonicjson.Config{ + CaseSensitive: true, + }.Froze() + // Unmarshal is equivalent to encoding/json.Unmarshal. - Unmarshal = sonicjson.ConfigDefault.Unmarshal + Unmarshal = config.Unmarshal // Marshal is equivalent to encoding/json.Marshal. - Marshal = sonicjson.ConfigDefault.Marshal + Marshal = config.Marshal // NewEncoder is equivalent to encoding/json.NewEncoder. - NewEncoder = sonicjson.ConfigDefault.NewEncoder + NewEncoder = config.NewEncoder // NewDecoder is equivalent to encoding/json.NewDecoder. - NewDecoder = sonicjson.ConfigDefault.NewDecoder + NewDecoder = config.NewDecoder // MarshalForDeterministicTesting marshals a value to JSON in a deterministic way for testing. // The normal sonic configuration does not guarantee deterministic output in terms of field order. // It panics if called outside of tests. diff --git a/tests/e2e/token_ratelimit_test.go b/tests/e2e/token_ratelimit_test.go index 56a8c8b64a..8ef5032f78 100644 --- a/tests/e2e/token_ratelimit_test.go +++ b/tests/e2e/token_ratelimit_test.go @@ -179,8 +179,8 @@ func Test_Examples_TokenRateLimit(t *testing.T) { Result []struct { Metric map[string]string `json:"metric"` Value []any `json:"value"` - } - } + } `json:"result"` + } `json:"data"` } var pr prometheusResponse require.NoError(t, json.Unmarshal(body, &pr))