{"id":13998122,"url":"https://github.com/theredfish/grillon","last_synced_at":"2025-04-24T06:43:13.770Z","repository":{"id":44684064,"uuid":"365496551","full_name":"theredfish/grillon","owner":"theredfish","description":"🦗 Grillon, an elegant and natural way to approach API testing in Rust.","archived":false,"fork":false,"pushed_at":"2025-04-23T14:50:50.000Z","size":1419,"stargazers_count":122,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T15:49:07.647Z","etag":null,"topics":["api","e2e-testing","http","rust-lang","testing-library"],"latest_commit_sha":null,"homepage":"https://theredfish.github.io/grillon/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theredfish.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"theredfish"}},"created_at":"2021-05-08T11:26:01.000Z","updated_at":"2025-04-23T14:49:50.000Z","dependencies_parsed_at":"2024-01-05T02:44:02.687Z","dependency_job_id":"711b8c4f-d4b8-4254-a24f-ee5afd778954","html_url":"https://github.com/theredfish/grillon","commit_stats":{"total_commits":28,"total_committers":2,"mean_commits":14.0,"dds":0.0714285714285714,"last_synced_commit":"7bb10fb29634e4ffd2e904208318eafb28d9cf36"},"previous_names":["owlduty/grillon"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theredfish%2Fgrillon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theredfish%2Fgrillon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theredfish%2Fgrillon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theredfish%2Fgrillon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theredfish","download_url":"https://codeload.github.com/theredfish/grillon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250467776,"owners_count":21435445,"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":["api","e2e-testing","http","rust-lang","testing-library"],"created_at":"2024-08-09T19:01:24.719Z","updated_at":"2025-04-24T06:43:13.761Z","avatar_url":"https://github.com/theredfish.png","language":"Rust","readme":"# Grillon\n\n[![Crates.io](https://img.shields.io/crates/v/grillon)](https://crates.io/crates/grillon)\n[![docs.rs](https://img.shields.io/docsrs/grillon)](https://docs.rs/grillon/latest/grillon)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/theredfish/grillon/ci.yml)\n[![Check Links](https://github.com/theredfish/grillon/actions/workflows/links.yml/badge.svg)](https://github.com/theredfish/grillon/actions/workflows/links.yml)\n\nGrillon offers an elegant and natural way to approach API testing in Rust.\n\n- Elegant, intuitive and expressive API\n- Built-in testing functions\n- Extensible\n\n\u003e Please note that the API is subject to a lot of changes until the `v1.0.0`.\n\n## Documentation\n\n- Book ([current](https://theredfish.github.io/grillon/current) | [dev](https://theredfish.github.io/grillon/dev))\n- [API doc](https://docs.rs/grillon/latest/grillon)\n- [Changelog](https://github.com/theredfish/grillon/blob/main/CHANGELOG.md)\n\n## Getting started\n\n\u003e Before you begin, be sure to read the book to learn more about configuring logs and assertions!\n\nYou need [Tokio](https://tokio.rs/) as asynchronous runtime. Generally, testing libs are\nused in unit or integration tests so let's declare `grillon` as a dev-dependency.\n\nAdd `grillon` to `Cargo.toml`\n\n```toml\n[dev-dependencies]\ngrillon = \"0.6.0\"\ntokio = { version = \"1\", features = [\"macros\"] }\n```\n\nThen use `grillon` :\n\n```rust\nuse grillon::{dsl::*, dsl::http::*, json, Grillon, StatusCode, Result};\nuse grillon::header::{HeaderValue, CONTENT_LENGTH, CONTENT_TYPE};\nuse grillon::Assert;\n\n#[tokio::test]\nasync fn end_to_end_test() -\u003e Result\u003c()\u003e {\n    Grillon::new(\"https://jsonplaceholder.typicode.com\")?\n        .post(\"posts\")\n        .payload(json!({\n            \"title\": \"foo\",\n            \"body\": \"bar\",\n            \"userId\": 1\n        }))\n        .assert()\n        .await\n        .status(is_success())\n        .status(is(201))\n        .response_time(is_less_than(700))\n        .json_body(is(json!({\n            \"id\": 101,\n        })))\n        .json_body(schema(json!({\n            \"properties\": {\n                \"id\": { \"type\": \"number\" }\n            }\n        })))\n        .json_path(\"$.id\", is(json!(101)))\n        .header(CONTENT_TYPE, is(\"application/json; charset=utf-8\"))\n        .headers(contains(vec![\n            (\n                CONTENT_TYPE,\n                HeaderValue::from_static(\"application/json; charset=utf-8\"),\n            ),\n            (CONTENT_LENGTH, HeaderValue::from_static(\"15\")),\n        ]))\n        .assert_fn(|assert| {\n            let Assert {\n                headers,\n                status,\n                json,\n                ..\n            } = assert.clone();\n\n            assert!(!headers.unwrap().is_empty());\n            assert!(status.unwrap() == StatusCode::CREATED);\n            assert!(json.is_some());\n\n            println!(\"Json response : {:#?}\", assert.json);\n        });\n\n    Ok(())\n}\n\n```\n","funding_links":["https://github.com/sponsors/theredfish"],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheredfish%2Fgrillon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheredfish%2Fgrillon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheredfish%2Fgrillon/lists"}