jsonparser
jsonparser copied to clipboard
One of the fastest alternative JSON parser for Go that does not require schema
``` // Is this a right way? func main() { var data = []byte(`[1,2,3]`) cnt := 2 data,_ = jsonparser.Set(data,[]byte("3,4"),fmt.Sprintf("[%v]", cnt)) fmt.Println(string(data)) // Output: [1,2,3,4] tmp := []int{} _ =...
**Description**: - Adding a simple public API allowing to guess what would be the result if we parse the data provided - Adding a way to stop array processing (like...
Hello, it's possible to use a jsonpath notation to perform the lookup? `jsonparser.Get(data, "$.person.name.fullName")` equivalent to: `jsonparser.Get(data, "person", "name", "fullName")` regards
https://github.com/buger/jsonparser/blob/09bcf22e90f420e8506eb6b88274a22775e389be/parser.go#L1040
If I call set on a deep nested JSON, the value after it returns misses the quotes required for a valid JSON Input JSON: ```JSON { "ipv4":{ "name":"testDependency", "source":{ "address":{...
``` data := []byte(`[1, 2, 3]`) jsonparser.ArrayEach(data, func(value []byte, dataType jsonparser.ValueType, offset int, err error) { fmt.Println(string(value)) }) ``` returns > 1 > 2 > 3 but ``` data :=...
when key found in JSON, Delete() will make a new slice and return it with new content. when key not found in JSON, Delete() will return the original slice. For...
Hi, ` data := []byte(`{ "key1": "v1" , "key2": "v2" }`) newData := jsonparser.Delete(data, "key1") fmt.Println(string(newData)) ` In the output, an extra comma exists, which is not a valid json....
I'm not sure if I'm doing something wrong, but I was surprised this produced allocations: ``` BenchmarkParse BenchmarkParse-8 300330 4085 ns/op 272 B/op 4 allocs/op PASS ``` ``` func BenchmarkEachKey(b...
This is ongoing PR but i wanted to show what i'm working on right now. There is 2 major changes here: - Support for querying multiple keys at once -...