{
  "id": 3233138,
  "title": "Baklava: Generate API Documentation and Type-Safe Clients from Scala Routing Tests",
  "url": "https://urgent.news/2026/08/25/baklava-generate-api-documentation-and-type-safe-clients-from-scala",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-25T09:49:56.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/katarzyna_kozowska/baklava-generate-api-documentation-and-type-safe-clients-from-scala-routing-tests-3eif"
  },
  "original_language": "en",
  "account": "API documentation often becomes outdated as code evolves, leading to mismatches between the documented contract and the actual API behavior. This problem arises because documentation and code are maintained separately, requiring manual updates and discipline in PRs. When an API grows, the issue compounds, causing integration errors and front-end breaks. Baklava is an open-source library by Iterators that addresses this issue by generating documentation from tests that verify actual API behavior. This ensures that the documentation remains accurate and up-to-date with the API, as the test serves as the documentation spec. To use Baklava, you integrate it into your existing test suite, defining routes with path(), supports(), and onRequest() scenarios that verify both API behavior and generate documentation. Baklava supports Pekko HTTP and http4s frameworks, integrates with ScalaTest, Specs2, and MUnit, and produces documentation in seven formats, including HTML, OpenAPI, TypeScript, oRPC, TypeScript Fetch Client, Postman, and sttp client. It is actively maintained under the Apache 2.0 license and does not require significant overhead, as it simply requires mixing in a trait and running your existing tests.",
  "summary": "API documentation has a reliability problem. The code gets updated; the OpenAPI spec gets forgotten. The spec gets updated; the TypeScript client doesn't regenerate. By the time an enterprise client asks for your API contract, the document you hand them describes a system that no longer exists. Baklava, an open-source library by Iterators , solves this structurally: documentation is generated…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}