Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.ckaratzas:vertx-openapi-spec-generator:jdk1.8'
}
<dependency>
<groupId>com.github.ckaratzas</groupId>
<artifactId>vertx-openapi-spec-generator</artifactId>
<version>jdk1.8</version>
</dependency>
libraryDependencies += "com.github.ckaratzas" % "vertx-openapi-spec-generator" % "jdk1.8"
:dependencies [[com.github.ckaratzas/vertx-openapi-spec-generator "jdk1.8"]]
The purpose of this repository is to facilitate the automatic generation of OpenAPI 3 spec from "rest-like" vertx routes. The functional nature of vertx makes this job difficult thus no serious official tool exists at the moment. In order to mitigate the problem we try to describe the general algorithm and assumptions made:
An actual application of these functions can be found at:
https://github.com/ckaratzas/tus-server-implementation/blob/master/src/main/java/com/tus/oss/server/core/ServerVerticle.java for generating the spec and https://github.com/ckaratzas/tus-server-implementation/blob/master/src/main/java/com/tus/oss/server/core/*Handler.java for the usage of annotations in handlers.
By no means the whole OpenAPI 3 spec is covered. The current codebase can be extended based on the actual use cases and support more OpenAPI specification. This repository can be used as a basis to inspire the design of official vertx "openapi-enabled" vertx routes in order to make the introspection easier and more effective.