summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoregernug <gerard.nugent@est.tech>2023-06-27 09:31:23 +0100
committeregernug <gerard.nugent@est.tech>2023-06-27 09:35:43 +0100
commit7ae1bcf4b463aec8c153feacfe32db4360e9c11d (patch)
tree64487e0b12a5c4efcc500074da7132a96c5b541a
parent48110553bc0e7099e5b675bb504cc73937c33d19 (diff)
Generate docs using OpenAPI 3.0
Doc generation in OpenAPI 3.0 requires executions for each file being generated. This change adds those executions and updates the dependency to copy these files. Issue-ID:CPS-1745 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: I144b49b0066f798f15408d955dcd914dd2c0bc91
-rwxr-xr-xcps-dependencies/pom.xml5
-rw-r--r--cps-ncmp-rest/pom.xml17
-rwxr-xr-xcps-rest/pom.xml17
3 files changed, 37 insertions, 2 deletions
diff --git a/cps-dependencies/pom.xml b/cps-dependencies/pom.xml
index 3eb2110c4d..e7c5096ca3 100755
--- a/cps-dependencies/pom.xml
+++ b/cps-dependencies/pom.xml
@@ -221,6 +221,11 @@
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>3.3.1</version>
+ </dependency>
</dependencies>
</dependencyManagement>
</project>
diff --git a/cps-ncmp-rest/pom.xml b/cps-ncmp-rest/pom.xml
index 6679932dbd..8db3628a94 100644
--- a/cps-ncmp-rest/pom.xml
+++ b/cps-ncmp-rest/pom.xml
@@ -179,9 +179,24 @@
</configOptions>
</configuration>
</execution>
+ <execution>
+ <id>ncmp-openapi-yaml-gen</id>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <phase>compile</phase>
+ <configuration>
+ <inputSpec>${project.basedir}/docs/openapi/openapi.yml</inputSpec>
+ <generatorName>openapi-yaml</generatorName>
+ <configOptions>
+ <outputFile>openapi.yaml</outputFile>
+ </configOptions>
+ </configuration>
+ </execution>
</executions>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
@@ -195,7 +210,7 @@
</outputDirectory>
<resources>
<resource>
- <directory>${project.basedir}/target/generated-sources/swagger/</directory>
+ <directory>${project.basedir}/target/generated-sources/openapi/</directory>
<includes>
<include>openapi*.yaml</include>
</includes>
diff --git a/cps-rest/pom.xml b/cps-rest/pom.xml
index c581b061dc..d3be9c3610 100755
--- a/cps-rest/pom.xml
+++ b/cps-rest/pom.xml
@@ -154,9 +154,24 @@
</configOptions>
</configuration>
</execution>
+ <execution>
+ <id>openapi-yaml-gen</id>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <phase>compile</phase>
+ <configuration>
+ <inputSpec>${project.basedir}/docs/openapi/openapi.yml</inputSpec>
+ <generatorName>openapi-yaml</generatorName>
+ <configOptions>
+ <outputFile>openapi.yaml</outputFile>
+ </configOptions>
+ </configuration>
+ </execution>
</executions>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
@@ -169,7 +184,7 @@
<outputDirectory>${project.basedir}/target/classes/static/api-docs/cps-core</outputDirectory>
<resources>
<resource>
- <directory>${project.basedir}/target/generated-sources/swagger/</directory>
+ <directory>${project.basedir}/target/generated-sources/openapi/</directory>
<includes>
<include>openapi.yaml</include>
</includes>