Introduction to Baklava
Baklava
Generate OpenAPI, HTML Docs or TypeScript client interface from routing tests.
Baklava is a Scala library that generates API documentation directly from your HTTP routing tests. Instead of maintaining documentation separately, your tests become the single source of truth for your API specification.
Supported stacks
- HTTP Servers: Pekko HTTP, http4s
- Test Frameworks: ScalaTest, Specs2, MUnit
- Output Formats: OpenAPI (with optional SwaggerUI), Simple, TS-REST
- Scala Versions: 2.13 and 3 (LTS)
- JDK: 11+
How it works
- Write routing tests using the Baklava DSL — define paths, methods, parameters, request/response examples
- Run your tests with
sbt test— Baklava serializes each test case to JSON intarget/baklava/calls/ - The SBT plugin automatically generates documentation from the collected test cases
Quick links
A library maintained by Iterators.