Closed sivadeilra closed 1 month ago
Been almost a year and these methods would be seriously useful.
Since this project is unmaintained, I forked to https://github.com/rustadopt/jzon-rs where I for example merged this PR and maintain it from now on with the community. It's also available in v0.12.5 on https://crates.io/crates/jzon
This adds JsonValue::as_object() and JsonValue::as_array() methods. This provides parity with the as_u32, as_str, etc. methods. It simplifies code that deals with objects and arrays directly, rather than using serde for a schematized view.
Also added JsonValue::get() and JsonValue::get_mut(), which forward their calls to Object.