Announcing serde-query

serde-query allows you to declaratively specify how to fetch the desired parts of a (potentially large) document with jq-like syntax and compiles it to an efficient serde::Deserialize implementation.

For example, you can extract only the commit messages from a GitHub API:

use serde_query::{DeserializeQuery, Query};

struct Message {
    message: String,

fn main() {
    let reader = ureq::get("")

    let messages: Vec<Query<Message>> = serde_json::from_reader(reader).unwrap();

    for message in messages.into_iter() {
        let message = Message::from(message);
        println!("{}", message.message);

I implemented this just out of curiosity, though I hope this library will help when you need to deal with an external API or process a massive data file.
(crosspost from reddit)


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.