Status: proof of concept
A gradle plugin for OpenApi client/server code generation. The tool generates type-safe client code with
OkHttpClient
and Javalin
server stub without annotations.
The plugin processes OpenAPI spec as an input (e.g. sample/openapi/spec.yml
).
Based on the spec the Gradle plugin generates:
- A client class with a number of methods mirroring a number of operations of the spec.
- A server interface which a developer should implement in some way.
- A controller which consumes Javalin instance and the server implementation.
- All request/response classes.
The plugin integrates into a build step and reflects all changes of the spec file.
See sample/src/test/kotlin/SampleTest.kt
for usage example.
- An
info->x-name
key might be used to assign a prefix for Client/Server/Controller generators.
- Implement HTTP requests with query, headers and form parameters
- Generate HTTP response classes
- Generate Javalin glue code (controller)
- Support multiple OpenAPI specs in a single module
- Implement request validation
- Implement auth
- Add retry policy and circuit breaker
- Implement other than JSON/Form content types.