You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to provide e.g. a.b2.test and would like to get "something else".
This is useful in scenarios where I am only interested in one specific attribute from a probably big json object.
With encoding/json I built a workaround which looped through each "layer" and parsed the object to a map[string]json.RawMessage which I then parsed until the leaf object.
Is there an easy (and opt. more performant) way here? I would like to have a way without the need of parsing the whole input when I only need a few bytes of it.
The text was updated successfully, but these errors were encountered:
Hi, thanks for the question. I think what you're asking for is related to a recent comment over at golang/go#71497 (comment)
There's already JSON Pointer [RFC 6901], which json/v2 is currently using to report error positions. However, it currently doesn't provide any means of going from a jsontext.Pointer to a particular jsontext.Value.
I'm going to close this. It's something worth potentially adding to json/v2 in the future, but that would probably be discussion to be held over in the golang/go repo.
I would like to be able to only parse a specific path in the json object.
e.g.
I would like to provide e.g.
a.b2.test
and would like to get"something else"
.This is useful in scenarios where I am only interested in one specific attribute from a probably big json object.
With
encoding/json
I built a workaround which looped through each "layer" and parsed the object to amap[string]json.RawMessage
which I then parsed until the leaf object.Is there an easy (and opt. more performant) way here? I would like to have a way without the need of parsing the whole input when I only need a few bytes of it.
The text was updated successfully, but these errors were encountered: