mirror of
https://gitlab.com/restcountries/restcountries.git
synced 2026-03-31 15:07:46 +01:00
add micronaut openapi spec generation
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
<!-- If you are building with JDK 9 or higher, you can uncomment the lines below to set the release version -->
|
||||
<release.version>14</release.version>
|
||||
<micronaut.version>2.0.1</micronaut.version>
|
||||
<micronautopenapi.version>2.0.0</micronautopenapi.version>
|
||||
<exec.mainClass>dev.amatos.restcountries.Application</exec.mainClass>
|
||||
<java.version>14</java.version>
|
||||
</properties>
|
||||
@@ -105,6 +106,10 @@
|
||||
<artifactId>resteasy-client</artifactId>
|
||||
<version>4.5.7.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -139,6 +144,11 @@
|
||||
<artifactId>micronaut-validation</artifactId>
|
||||
<version>${micronaut.version}</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>io.micronaut.openapi</groupId>
|
||||
<artifactId>micronaut-openapi</artifactId>
|
||||
<version>${micronautopenapi.version}</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
<compilerArgs>
|
||||
<arg>-Amicronaut.processing.group=dev.amatos.restcountries</arg>
|
||||
|
||||
@@ -2,6 +2,21 @@ package dev.amatos.restcountries;
|
||||
|
||||
import io.micronaut.runtime.Micronaut;
|
||||
|
||||
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
|
||||
import io.swagger.v3.oas.annotations.info.Contact;
|
||||
import io.swagger.v3.oas.annotations.info.Info;
|
||||
import io.swagger.v3.oas.annotations.info.License;
|
||||
|
||||
|
||||
@OpenAPIDefinition(
|
||||
info = @Info(
|
||||
title = "rest-countries",
|
||||
version = "3.1",
|
||||
description = "Get information about countries via a RESTful API",
|
||||
license = @License(name = "Mozilla Public License MPL 2.0", url = "https://www.mozilla.org/en-US/MPL/2.0/"),
|
||||
contact = @Contact(url = "https://restcountries.com", name = "Alejandro Matos")
|
||||
)
|
||||
)
|
||||
public class Application {
|
||||
public static void main(String[] args) {
|
||||
Micronaut.run(Application.class, args);
|
||||
|
||||
Reference in New Issue
Block a user