| = Apache Geronimo OpenAPI |
| :jbake-date: 2018-07-24 |
| :icons: font |
| |
| Apache Geronimo OpenAPI is an implementation of Microprofile OpenAPI. |
| It is highly inspired from Swagger and relies on the OpenAPI initiative. |
| It allows you to document your endpoint using annotations or a pre-generated JSON. |
| |
| == Dependencies |
| |
| === API |
| |
| [source,xml] |
| ---- |
| <dependency> |
| <groupId>org.eclipse.microprofile.openapi</groupId> |
| <artifactId>microprofile-openapi-api</artifactId> |
| <version>1.0.1</version> |
| </dependency> |
| ---- |
| |
| === Implementation |
| |
| [source,xml] |
| ---- |
| <dependency> |
| <groupId>org.apache.geronimo</groupId> |
| <artifactId>geronimo-openapi-impl</artifactId> |
| <version>1.0.0</version> |
| </dependency> |
| ---- |
| |
| === Maven Plugin |
| |
| The maven plugin allows you to generate an ̀`openapi.json` at build time: |
| |
| [source,xml] |
| ---- |
| <plugin> |
| <groupId>org.apache.geronimo</groupId> |
| <artifactId>geronimo-openapi-maven-plugin</artifactId> |
| <version>${openapi.version}</version> |
| <executions> |
| <execution> |
| <id>generate-openapi.json</id> |
| <goals> |
| <goal>openapi.json</goal> |
| </goals> |
| <configuration> |
| <application>com.test.MyApp</application> |
| <endpointClasses> |
| <endpointClass>com.test.SomeEndpoint</endpointClass> |
| <endpointClass>com.test.SomeOtherEndpoint</endpointClass> |
| </endpointClasses> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| ---- |
| |
| Since it uses static analysis (no scanning yet) then you need to fill the application class |
| if you have any custom configuration on it and all endpoints you want to document. |
| |
| Then for your runtime you can set the following configuration entries to avoid the runtime to scan again `mp.openapi.scan.disable=true`. |
| |