aboutsummaryrefslogtreecommitdiffstats
path: root/main/pom.xml
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-11-11 15:57:47 +0000
committerliamfallon <liam.fallon@est.tech>2022-11-11 15:57:53 +0000
commit004075aea4b207ad98a182f1e261e7f36d374d22 (patch)
tree1d376ed4e8d530ad3c0946122b2a1ea20548f382 /main/pom.xml
parent61020567b79651a65a3c7bf07f799105238f5c95 (diff)
Add OpenAPI Swagger 3 spc and API generation
This commit adds the Policy/API OpenAPI (Swagger) document as a source document under source control. This OpenAPI document was generated from the existing SpringFox annotations in the source code, was uploaded to the online Swagger editor and was converted into OpenAPI 3.0 format. It was then manually edited to correct the return types and to match the input and putput types to our Java classes. The pom.xml is also amended to generate the API interface source doe in the target/generated-sources directory. The generated code does NOT replace the existing API code as yet. Issue-ID: POLICY-4431 Change-Id: Idf3763fe99fc9dfa5739d9074213fa7d293fbba6 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'main/pom.xml')
-rw-r--r--main/pom.xml34
1 files changed, 34 insertions, 0 deletions
diff --git a/main/pom.xml b/main/pom.xml
index 6b2a5b8e..588b59d9 100644
--- a/main/pom.xml
+++ b/main/pom.xml
@@ -136,6 +136,40 @@
</resources>
<plugins>
<plugin>
+ <groupId>io.swagger.codegen.v3</groupId>
+ <artifactId>swagger-codegen-maven-plugin</artifactId>
+ <version>3.0.27</version>
+ <executions>
+ <execution>
+ <id>code-gen</id>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <inputSpec>${project.basedir}/src/main/resources/openapi/openapi.yaml</inputSpec>
+ <invokerPackage>org.onap.policy.api.main.rest</invokerPackage>
+ <modelPackage>org.onap.policy.models.tosca.authorative.concepts</modelPackage>
+ <apiPackage>org.onap.policy.api.main.rest</apiPackage>
+ <language>spring</language>
+ <generateModels>false</generateModels>
+ <generateSupportingFiles>false</generateSupportingFiles>
+ <importMappings>
+ ToscaServiceTemplate=org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate,
+ ToscaNodeTemplateArray=java.util.List,
+ HealthCheckReport=org.onap.policy.common.endpoints.report.HealthCheckReport,
+ StatisticsReport=org.onap.policy.api.main.rest.provider.statistics.StatisticsReport,
+ </importMappings>
+ <configOptions>
+ <sourceFolder>src/gen/java</sourceFolder>
+ <dateLibrary>java11</dateLibrary>
+ <interfaceOnly>true</interfaceOnly>
+ <useTags>true</useTags>
+ </configOptions>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>