https://github.com/javalin/javalin-openapi
Annotation processor for compile-time OpenAPI & JsonSchema, with out-of-the-box support for Javalin 5.x, Swagger & ReDoc
https://github.com/javalin/javalin-openapi
annotation-processor hacktoberfest javalin javalin-openapi javalin-plugin json-schema openapi openapi3 redoc swagger swagger-ui
Last synced: 3 months ago
JSON representation
Annotation processor for compile-time OpenAPI & JsonSchema, with out-of-the-box support for Javalin 5.x, Swagger & ReDoc
- Host: GitHub
- URL: https://github.com/javalin/javalin-openapi
- Owner: javalin
- License: apache-2.0
- Created: 2021-05-04T16:10:52.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-06-22T22:08:45.000Z (4 months ago)
- Last Synced: 2025-06-22T23:19:22.303Z (4 months ago)
- Topics: annotation-processor, hacktoberfest, javalin, javalin-openapi, javalin-plugin, json-schema, openapi, openapi3, redoc, swagger, swagger-ui
- Language: Kotlin
- Homepage: https://github.com/javalin/javalin-openapi/wiki
- Size: 748 KB
- Stars: 54
- Watchers: 6
- Forks: 20
- Open Issues: 10
-
Metadata Files:
- Readme: .github/README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# OpenAPI Plugin [](https://github.com/javalin/javalin-openapi/actions/workflows/gradle.yml)  [](https://maven.reposilite.com/#/snapshots/io/javalin/community/openapi)
Compile-time OpenAPI integration for Javalin 6.x ecosystem.
This is a new plugin that replaces [old built-in OpenApi module](https://github.com/javalin/javalin/tree/javalin-4x/javalin-openapi),
the API looks quite the same despite some minor changes.
### How to use
* [Wiki / Installation](https://github.com/javalin/javalin-openapi/wiki/1.-Installation)
* [Wiki / Setup](https://github.com/javalin/javalin-openapi/wiki/2.-Setup)
* [Wiki / Features](https://github.com/javalin/javalin-openapi/wiki/3.-Features)### Notes
* Reflection free, does not perform any extra operations at runtime
* Uses `@OpenApi` to simplify migration from bundled OpenApi implementation
* Supports Java 11+ (also 16 and any further releases) and Kotlin (through [Kapt](https://kotlinlang.org/docs/kapt.html))
* Uses internal WebJar handler that works with `/*` route out of the box
* Provides better projection of OpenAPI specification
* Schema validation through Swagger core module### Other examples
* [Test module](https://github.com/javalin/javalin-openapi/blob/main/examples/javalin-gradle-kotlin/src/main/java/io/javalin/openapi/plugin/test/JavalinTest.java) - `JavalinTest` shows how this plugin work in Java codebase using various features
* [Reposilite](https://github.com/dzikoysk/reposilite) - real world app using Javalin and OpenApi integration### Repository structure
#### Universal modules
| Module | Description |
|:-------------------------------|:-------------------------------------------------------------------------------------------|
| `openapi-annotation-processor` | Compile-time annotation processor, should generate `/openapi-plugin/openapi.json` resource |
| `openapi-specification` | Annotations & classes used to describe OpenAPI specification |
| `openapi-test` | Example Javalin application that uses OpenApi plugin in Gradle & Maven |#### Javalin plugins
| Plugin | Description |
|:-------------------------|:-------------------------------------------------------------------------------|
| `javalin-openapi-plugin` | Loads `/openapi-plugin/openapi.json` resource and serves main OpenApi endpoint |
| `javalin-swagger-plugin` | Serves Swagger UI |
| `javalin-redoc-plugin` | Serves ReDoc UI |#### Branches
| Branch | Javalin version | OpenApi Version | Java Version |
|:-------------------------------------------------------------|:----------------|:----------------|:-------------|
| [main](https://github.com/javalin/javalin-openapi/tree/main) | 6.x | 6.x | JDK11 |
| [5.x](https://github.com/javalin/javalin-openapi/tree/5.x) | 5.x | 5.x | JDK11 |
| [4.x](https://github.com/javalin/javalin-openapi/tree/4.x) | 4.x | 1.x | JDK8 |