Add generation of API yaml file

Change-Id: I893e4ecb0c89b92d5c5cdecd2dc72a603d5340bb
Issue-ID: NONRTRIC-354
Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
diff --git a/enrichment-coordinator-service/pom.xml b/enrichment-coordinator-service/pom.xml
index d34c9a6..2a65315 100644
--- a/enrichment-coordinator-service/pom.xml
+++ b/enrichment-coordinator-service/pom.xml
@@ -56,6 +56,7 @@
         <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
         <formatter-maven-plugin.version>2.12.2</formatter-maven-plugin.version>
         <spotless-maven-plugin.version>1.24.3</spotless-maven-plugin.version>
+        <swagger-codegen-maven-plugin.version>3.0.11</swagger-codegen-maven-plugin.version>
         <docker-maven-plugin>0.30.0</docker-maven-plugin>
         <version.dmaap>1.1.11</version.dmaap>
         <javax.ws.rs-api.version>2.1.1</javax.ws.rs-api.version>
@@ -281,6 +282,27 @@
                 </executions>
             </plugin>
             <plugin>
+                <groupId>io.swagger.codegen.v3</groupId>
+                <artifactId>swagger-codegen-maven-plugin</artifactId>
+                <version>${swagger-codegen-maven-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <inputSpec>${project.basedir}/api/ecs-api.json</inputSpec>
+                            <language>openapi-yaml</language>
+                            <output>${project.basedir}/api</output>
+                            <configOptions>
+                                <outputFile>ecs-api.yaml</outputFile>
+                            </configOptions>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>io.fabric8</groupId>
                 <artifactId>docker-maven-plugin</artifactId>
                 <version>${docker-maven-plugin}</version>