How to parse json as not strongly typed strcture?


#1

I know how to parse JSON in to a defined structure with Serialize and Deserialize attributes. But how can I process json tree without knowing structure of JSON in advance?

If you are familiar with Java or Scala, I am looking for analogy of Play Json, i.e. I would like to do in Rust something like the following in Scala: https://www.playframework.com/documentation/2.4.x/ScalaJson#Using-string-parsing


#2

You can deserialize to a serde_json::Value: https://docs.rs/serde_json/1.0.17/serde_json/enum.Value.html


#3

Great! Thanks, I was looking for this.