{"id":18812410,"url":"https://github.com/warrant-dev/apirunner","last_synced_at":"2025-07-26T18:04:22.409Z","repository":{"id":60945828,"uuid":"545212208","full_name":"warrant-dev/apirunner","owner":"warrant-dev","description":"A lightweight test runner for testing http APIs","archived":false,"fork":false,"pushed_at":"2024-09-09T23:33:52.000Z","size":60,"stargazers_count":34,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T21:13:35.120Z","etag":null,"topics":["apis","go","golang","json","testing"],"latest_commit_sha":null,"homepage":"","language":"Go","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/warrant-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-10-04T01:15:25.000Z","updated_at":"2024-10-22T09:15:10.000Z","dependencies_parsed_at":"2023-10-13T10:45:27.288Z","dependency_job_id":"a9efd724-9857-40a0-bf80-291583ef3d1e","html_url":"https://github.com/warrant-dev/apirunner","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/warrant-dev/apirunner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrant-dev%2Fapirunner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrant-dev%2Fapirunner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrant-dev%2Fapirunner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrant-dev%2Fapirunner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/warrant-dev","download_url":"https://codeload.github.com/warrant-dev/apirunner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrant-dev%2Fapirunner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267205992,"owners_count":24052762,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["apis","go","golang","json","testing"],"created_at":"2024-11-07T23:32:45.343Z","updated_at":"2025-07-26T18:04:22.224Z","avatar_url":"https://github.com/warrant-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Runner\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/warrant-dev/apirunner)](https://goreportcard.com/report/github.com/warrant-dev/apirunner)\n\nA lightweight test runner for testing http APIs. Define test cases as json and execute them against any server (local or over the network).\n\nWritten in Go. Built by the [Warrant](https://warrant.dev/) team.\n\n## Usage\n\n### Install\n\n```shell\ngo get github.com/warrant-dev/apirunner\n```\n\n### Define API tests as json\n\nSample test file:\n\n```json\n{\n    \"ignoredFields\": [\n        \"internalId\"\n    ],\n    \"tests\": [\n        {\n            \"name\": \"createUser\",\n            \"request\": {\n                \"method\": \"POST\",\n                \"url\": \"/users\",\n                \"body\": {\n                    \"email\": \"someemail@gmail.com\"\n                }\n            },\n            \"expectedResponse\": {\n                \"statusCode\": 200,\n                \"body\": {\n                    \"userId\": \"{{ createUser.userId }}\",\n                    \"email\": \"someemail@gmail.com\"\n                }\n            }\n        },\n        {\n            \"name\": \"getUserById\",\n            \"request\": {\n                \"method\": \"GET\",\n                \"url\": \"/users/{{ createUser.userId }}\"\n            },\n            \"expectedResponse\": {\n                \"statusCode\": 200,\n                \"body\": {\n                    \"userId\": \"{{ createUser.userId }}\",\n                    \"email\": \"someemail@gmail.com\"\n                }\n            }\n        },\n        {\n            \"name\": \"deleteUser\",\n            \"request\": {\n                \"method\": \"DELETE\",\n                \"url\": \"/users/{{ createUser.userId }}\"\n            },\n            \"expectedResponse\": {\n                \"statusCode\": 200\n            }\n        }\n    ]\n}\n```\n\n### Execute tests\n\n```go\nimport (\n\t\"github.com/warrant-dev/apirunner\"\n)\n\n// Execute all tests in 'mytestfile.json' and print results\nfunc main() {\n    runner, err := apirunner.NewRunner(apirunner.Config{\n        TestFileName:  \"mytestfile.json\",\n        BaseUrl:       \"http://localhost:8000\",\n        CustomHeaders: nil,\n    })\n    if err != nil {\n        panic(err)\n    }\n    runner.Execute()\n}\n```\n\n## Features\n\n- Supports all HTTP operations (`GET`, `POST`, `PUT`, `DELETE` etc.)\n- Deep comparison of json responses (objects and arrays)\n- Inject custom headers via config (useful for passing auth tokens)\n- `ignoredFields` to ignore specific attributes during comparison (ex. non-deterministic ids, timestamps)\n- Memoization of response attributes to support request chaining. For example, this test references an id of a resource created by a previous request:\n\n```json\n{\n    \"name\": \"updateResourceTest\",\n    \"request\": {\n        \"method\": \"PUT\",\n        \"url\": \"/resources/{{ createResourceTest.Id }}\",\n        \"body\": {\n            \"email\": \"someupdatedemail@gmail.com\"\n        }\n    },\n    \"expectedResponse\": {\n        \"statusCode\": 200,\n        \"body\": {\n            \"id\": \"{{ createResourceTest.Id }}\",\n            \"email\": \"someupdatedemail@gmail.com\"\n        }\n    }\n}\n```\n\n## Development\n\nPRs welcome! Clone and develop locally:\n\n```shell\ngit clone git@github.com:warrant-dev/apirunner.git\ncd apirunner\ngo test\n```\n\n## About Warrant\n\n[Warrant](https://warrant.dev/) provides APIs and infrastructure for implementing authorization and access control.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarrant-dev%2Fapirunner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwarrant-dev%2Fapirunner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarrant-dev%2Fapirunner/lists"}