Add OpenAPI Swagger 3 spec and API generation
[policy/pap.git] / main / pom.xml
index 06c0334..d018e69 100644 (file)
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.policy.pap</groupId>
         <artifactId>policy-pap</artifactId>
-        <version>2.6.1-SNAPSHOT</version>
+        <version>2.8.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>pap-main</artifactId>
@@ -42,7 +42,6 @@
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-jpa</artifactId>
-            <version>${version.springboot}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-aop</artifactId>
-            <version>${version.springboot}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-actuator</artifactId>
-            <version>${version.springboot.actuator}</version>
         </dependency>
         <dependency>
             <groupId>io.micrometer</groupId>
             <artifactId>springfox-swagger-ui</artifactId>
             <scope>runtime</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.kafka</groupId>
+            <artifactId>kafka-clients</artifactId>
+            <scope>provided</scope>
+        </dependency>
 
         <dependency>
             <groupId>org.onap.policy.common</groupId>
             </resource>
         </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.pap.main.rest</invokerPackage>
+                            <modelPackage>org.onap.policy.models.tosca.authorative.concepts</modelPackage>
+                            <apiPackage>org.onap.policy.pap.main.rest</apiPackage>
+                            <language>spring</language>
+                            <generateModels>false</generateModels>
+                            <generateSupportingFiles>false</generateSupportingFiles>
+                            <importMappings>
+                                HealthCheckReport=org.onap.policy.common.endpoints.report.HealthCheckReport,
+                                StatisticsReport=org.onap.policy.pap.main.rest.StatisticsReport,
+                                PdpStatistics=org.onap.policy.models.pdp.concepts.PdpStatistics,
+                                Pdps=org.onap.policy.models.pdp.concepts.Pdps,
+                                PdpState=org.onap.policy.models.pdp.enums.PdpState,
+                                PdpGroupUpdateResponse=org.onap.policy.models.pap.concepts.PdpGroupUpdateResponse,
+                                PdpGroupStateChangeResponse=org.onap.policy.models.pap.concepts.PdpGroupStateChangeResponse,
+                                PdpGroupDeleteResponse=org.onap.policy.models.pap.concepts.PdpGroupDeleteResponse,
+                                PdpGroupDeployResponse=org.onap.policy.models.pap.concepts.PdpGroupDeployResponse,
+                                DeploymentGroups=org.onap.policy.models.pdp.concepts.DeploymentGroups,
+                                PdpDeployPolicies=org.onap.policy.models.pap.concepts.PdpDeployPolicies,
+                                PdpGroups=org.onap.policy.models.pdp.concepts.PdpGroups,
+                                PolicyAudit=org.onap.policy.models.pap.concepts.PolicyAudit,
+                                PolicyStatus=org.onap.policy.models.pap.concepts.PolicyStatus
+                            </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>