{"id":22740678,"url":"https://github.com/notbad4u/query_params","last_synced_at":"2025-04-14T05:53:28.809Z","repository":{"id":62443466,"uuid":"100073965","full_name":"NotBad4U/query_params","owner":"NotBad4U","description":"Custom derive to automatically implement serialization to http query params for arbitrary structs.","archived":false,"fork":false,"pushed_at":"2017-08-19T23:23:11.000Z","size":12,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T05:53:24.879Z","etag":null,"topics":["custom-derive","derive","http-client","macros","query-params","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NotBad4U.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-11T22:23:33.000Z","updated_at":"2023-09-14T23:47:18.000Z","dependencies_parsed_at":"2022-11-01T21:50:32.798Z","dependency_job_id":null,"html_url":"https://github.com/NotBad4U/query_params","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotBad4U%2Fquery_params","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotBad4U%2Fquery_params/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotBad4U%2Fquery_params/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotBad4U%2Fquery_params/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NotBad4U","download_url":"https://codeload.github.com/NotBad4U/query_params/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830389,"owners_count":21168272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-derive","derive","http-client","macros","query-params","rust"],"created_at":"2024-12-10T23:10:16.246Z","updated_at":"2025-04-14T05:53:28.787Z","avatar_url":"https://github.com/NotBad4U.png","language":"Rust","readme":"[![Build Status](https://travis-ci.org/NotBad4U/query_params.svg?branch=master)](https://travis-ci.org/NotBad4U/query_params)\n[![Rust version]( https://img.shields.io/badge/rust-stable-blue.svg)]()\n\n\n# QueryParams Derive\n\n[Rust][rust] custom derive to automatically implement serialization to http query params for arbitrary structs. A simple `#[derive(QueryParams)]` will generate a function `to_query_params` for your struct.\n\n## How it Works\n\n```rust\n#[macro_use]\nextern crate query_params;\n\n#[derive(QueryParams)]\nstruct PullRequestsParametersApi {\n    page: i32,\n    sort: bool,\n    direction: String,\n    state: Vec\u003cString\u003e,\n    // .. other interesting fields ..\n} \n\nfn main() {\n    let pr = PullRequestsParametersApi {\n        page: 2,\n        sort: true,\n        direction: \"asc\",\n        state: vec![\"open\".to_string(), \"closed\".to_string()],\n    }\n\n    println!(\"{}\", pr.to_query_params()); // =\u003e ?page=2\u0026sort=true\u0026direction=asc\u0026state=open,closed\n}\n```\n\n## Get Started\n\nIt's as simple as two steps:\n\n1. Add `query_params` to your `Cargo.toml` \n  * manually \n\n  * or with [cargo-edit](https://github.com/killercup/cargo-edit):\n  \n    `cargo add derive_builder`\n\n2. Annotate your struct with `#[derive(QueryParams)]`\n\n## Disclaimer :exclamation:\n\n* Tuple structs and unit structs are not supported as they have no field names.\n\n## [Documentation][doc]\n\nDetailed explaination of all features and tips for troubleshooting.\n\n### Contribution\n\nFeel free to make a pull request :smiley:\n\n[doc]: https://docs.rs/query_params\n[rust]: https://www.rust-lang.org/","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotbad4u%2Fquery_params","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotbad4u%2Fquery_params","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotbad4u%2Fquery_params/lists"}