Generating openapi documentation from openapi.yaml 49/125849/1
authorputhuparambil.aditya <aditya.puthuparambil@bell.ca>
Tue, 23 Nov 2021 14:53:43 +0000 (14:53 +0000)
committerputhuparambil.aditya <aditya.puthuparambil@bell.ca>
Tue, 23 Nov 2021 14:53:43 +0000 (14:53 +0000)
Issue-ID: CPS-755
Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca>
Change-Id: Ib19afce259639d0154e6dbeb825c5da0e3dbfa3a

pom.xml
src/main/resources/application.yml

diff --git a/pom.xml b/pom.xml
index 552d30f..cc74f4c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                 </exclusion>
             </exclusions>
         </dependency>
+        <dependency>
+            <groupId>org.springdoc</groupId>
+            <artifactId>springdoc-openapi-ui</artifactId>
+            <version>1.5.9</version>
+        </dependency>
         <dependency>
             <groupId>org.spockframework</groupId>
             <artifactId>spock-core</artifactId>
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.basedir}/target/classes/static/api-docs</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${project.basedir}/target/generated-sources/swagger/</directory>
+                                    <includes>
+                                        <include>openapi.yaml</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
index 1a3b843..67cd28e 100644 (file)
@@ -74,3 +74,11 @@ logging:
     console: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
     file: "%d %p %c{1.} [%t] %m%n"
   file: dmi.log
+
+springdoc:
+  swagger-ui:
+    disable-swagger-default-url: true
+    urlsPrimaryName: query
+    urls:
+      - name: query
+        url: /api-docs/openapi.yaml
\ No newline at end of file