Closed janisz closed 1 year ago
Here is breaking test for built in modifier
func TestGetManyBytes(t *testing.T) {
rawJson := `{"x":[{"y":[{"z":{"b":1, "c": 2, "a": 3}}]}]}`
jsonPathExpr := `x.#.y.#.z.@pretty:{"sortKeys":true}`
results := gjson.GetManyBytes([]byte(rawJson), jsonPathExpr)
assert.Len(t, results, 1)
actua := results[0].Raw
expected := `[[{
"a": 3,
"b": 1,
"c": 2
}
]]`
assert.Equal(t, expected, actua)
}
Consider following tests. It's passing on 1.14.1 but fails on 1.14.2 with
Refs: https://github.com/stackrox/stackrox/pull/2654 Introduced in: https://github.com/tidwall/gjson/commit/475b4036c39569593ccabc9770b1188ffd2193e0