Baklava Library Generates API Docs and Type-Safe Clients from Scala Routing Tests
Baklava is an open-source Scala library by Iterators that generates API documentation directly from routing tests, eliminating the common problem of documentation drifting out of sync with actual code. When tests run, Baklava observes each request and response to infer the API surface and produce documentation as a test output rather than a separately maintained file. If a route changes and the test breaks, the documentation will not publish until the test is corrected, making drift structurally impossible. The library supports Pekko HTTP and http4s frameworks, integrates with ScalaTest, Specs2, and MUnit, and can output in seven formats including OpenAPI, TypeScript clients, Postman collections, and an sttp Scala client. Baklava v1.4.0 was released in May 2026 under the Apache 2.0 license and is actively maintained by Iterators.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in