The OAS Generator is a java annotation processor that generates an OpenAPI specification file from the java annotations within the source code. Because the file is generated during compilation, the documentation is always up-to-date and references the current state of the implementation.
-
OpenAPI Specification 3.1.0 (Link)
-
Add the corresponding dependency to your project
<dependency> <groupId>com.github.chhorz</groupId> <artifactId>oas-generator-{spring-web|jaxrs|schema|asciidoctor}</artifactId> <version>${oas-generator.version}</version> </dependency>
-
Create a configuration file
oas-generator.yml
(per default in /src/main/resources). An example can be found in the reference documentation. -
Update the Javadoc comments to match the requirements
The documentation can be found on the separate GitHub Page. The page also includes the reference documentation for all versions.
Snapshots are available from the Sonatype OSS Snapshots repository. To configure the repository for your project to use the latest snapshot versions you have to add the following repository to your maven pom:
<repositories>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
OAS Generator is Open Source software released under the Apache 2.0 license.