An expressive and versatile end-to-end HTTP API testing library for Go, built on top of the gentleman HTTP client toolkit.
Baloo is an HTTP API testing library for Go that provides a fluent, expressive API for writing end-to-end tests. It solves the problem of verbose and repetitive HTTP testing code by offering a declarative syntax with built-in assertions for status codes, headers, JSON bodies, and schema validation. Built on top of the gentleman HTTP client toolkit, it integrates directly with Go's standard testing package.
Go developers who need to write integration or end-to-end tests for HTTP APIs, particularly those working on RESTful services, microservices, or backend systems requiring reliable API contract validation.
Developers choose Baloo for its clean, chainable API that reduces boilerplate, its robust built-in assertions (especially for JSON), and its extensibility through custom assertion functions. It strikes a balance between convenience and flexibility, making it easier to write comprehensive API tests without sacrificing control.
Expressive end-to-end HTTP API testing made easy in Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Chainable methods like .Get().Expect().Status() provide a clean, readable syntax that reduces boilerplate, as shown in the simple example where multiple assertions are combined in one line.
Deep JSON comparison and JSON Schema validation allow precise API response checks without manual parsing, evidenced by the JSON() and JSONSchema() methods in the examples.
Custom assertion functions via AssertFunc and global aliases with AddAssertFunc enable developers to add bespoke validation logic, as demonstrated in the custom assertion examples.
Leverages gentleman's middleware layer and HTTP client DSL, providing a stable foundation with features like easy configuration and composable requests, mentioned in the features list.
Relies on the gentleman HTTP client toolkit, adding an extra dependency that can introduce complexity and potential breaking changes, as noted in the version history tied to gentleman updates.
Currently only integrates with Go's native testing package, with other engines 'might be added in the future,' restricting use in projects with alternative test runners like Ginkgo.
JSON Schema validation requires defining schemas as strings or external resources, which can be cumbersome for complex APIs, as seen in the example where the schema is a const string variable.