Move Swagger API to docs folder 15/138915/2
authoregernug <gerard.nugent@est.tech>
Mon, 9 Sep 2024 11:05:52 +0000 (12:05 +0100)
committeregernug <gerard.nugent@est.tech>
Tue, 10 Sep 2024 09:04:57 +0000 (10:04 +0100)
Use docs folder for code genereation

Issue-ID: CPS-2332

Change-Id: Ifd59025014766667e63baee65a06522903fd7da2
Signed-off-by: egernug <gerard.nugent@est.tech>
dmi-service/pom.xml
docs/api/swagger/openapi-datajob.yaml

index 0e75008..7b2c54c 100644 (file)
                             <goal>generate</goal>
                         </goals>
                         <configuration>
-                            <inputSpec>${project.basedir}/openapi/openapi.yml</inputSpec>
+                            <inputSpec>${project.basedir}/../docs/api/swagger/openapi.yaml</inputSpec>
                             <generatorName>spring</generatorName>
                             <generateSupportingFiles>false</generateSupportingFiles>
                             <invokerPackage>org.onap.cps.ncmp.dmi.rest.controller</invokerPackage>
                             <goal>generate</goal>
                         </goals>
                         <configuration>
-                            <inputSpec>${project.basedir}/openapi/openapi-datajob.yml</inputSpec>
+                            <inputSpec>${project.basedir}/../docs/api/swagger/openapi-datajob.yaml</inputSpec>
                             <generatorName>spring</generatorName>
                             <generateSupportingFiles>false</generateSupportingFiles>
                             <invokerPackage>org.onap.cps.ncmp.dmi.datajobs.rest.controller</invokerPackage>
                         </goals>
                         <phase>compile</phase>
                         <configuration>
-                            <inputSpec>${project.basedir}/openapi/openapi.yml</inputSpec>
+                            <inputSpec>${project.basedir}/../docs/api/swagger/openapi.yaml</inputSpec>
                             <generatorName>openapi-yaml</generatorName>
                             <configOptions>
                                 <outputFile>openapi/openapi.yaml</outputFile>
                         </goals>
                         <phase>compile</phase>
                         <configuration>
-                            <inputSpec>${project.basedir}/openapi/openapi-datajob.yml</inputSpec>
+                            <inputSpec>${project.basedir}/../docs/api/swagger/openapi-datajob.yaml</inputSpec>
                             <generatorName>openapi-yaml</generatorName>
                             <configOptions>
                                 <outputFile>openapi/openapi-datajob.yaml</outputFile>
                     </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/openapi/openapi</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 54ce066..ef435f5 100644 (file)
@@ -5,25 +5,25 @@ info:
   title: NCMP Data Subjob API
   version: 1.0.0
 servers:
-  - url: /dmi
+- url: /dmi
 tags:
-  - description: DMI plugin rest apis
-    name: dmi-datajob
+- description: DMI plugin rest apis
+  name: dmi-datajob
 paths:
   /v1/cmreadJob:
     post:
       description: Create a read request
       operationId: readDataJob
       parameters:
-        - description: The destination of the results (Kafka topic name or s3 bucket
-            name)
-          in: query
-          name: destination
-          required: true
-          schema:
-            example: some-destination
-            type: string
-          style: form
+      - description: The destination of the results (Kafka topic name or s3 bucket
+          name)
+        in: query
+        name: destination
+        required: true
+        schema:
+          example: some-destination
+          type: string
+        style: form
       requestBody:
         content:
           application/3gpp-json-patch+json:
@@ -42,21 +42,21 @@ paths:
                 $ref: '#/components/schemas/ErrorMessage'
           description: Not Implemented
       tags:
-        - dmi-datajob
+      - dmi-datajob
   /v1/cmwriteJob:
     post:
       description: Create a write request
       operationId: writeDataJob
       parameters:
-        - description: The destination of the results (Kafka topic name or s3 bucket
-            name)
-          in: query
-          name: destination
-          required: true
-          schema:
-            example: some-destination
-            type: string
-          style: form
+      - description: The destination of the results (Kafka topic name or s3 bucket
+          name)
+        in: query
+        name: destination
+        required: true
+        schema:
+          example: some-destination
+          type: string
+        style: form
       requestBody:
         content:
           application/3gpp-json-patch+json:
@@ -75,36 +75,30 @@ paths:
                 $ref: '#/components/schemas/ErrorMessage'
           description: Not Implemented
       tags:
-        - dmi-datajob
+      - dmi-datajob
   /v1/cmwriteJob/dataProducer/{dataProducerId}/dataProducerJob/{dataProducerJobId}/status:
     get:
       description: Retrieve the status of a specific data job.
       operationId: getDataJobStatus
       parameters:
-        - description: Identifier for the data producer
-          in: path
-          name: dataProducerId
-          required: true
-          schema:
-            example: some-data-producer-identifier
-            type: string
-          style: simple
-        - description: Identifier for the data producer job
-          in: path
-          name: dataProducerJobId
-          required: true
-          schema:
-            example: some-producer-job-identifier
-            type: string
-          style: simple
-        - description: Identifier for the data producer
-          in: query
-          name: dataProducerId
-          required: true
-          schema:
-            example: some-data-producer-identifier
-            type: string
-          style: form
+      - description: Identifier for the data producer
+        explode: false
+        in: path
+        name: dataProducerId
+        required: true
+        schema:
+          example: some-data-producer-identifier
+          type: string
+        style: simple
+      - description: Identifier for the data producer job
+        explode: false
+        in: path
+        name: dataProducerJobId
+        required: true
+        schema:
+          example: some-producer-job-identifier
+          type: string
+        style: simple
       responses:
         "501":
           content:
@@ -117,45 +111,39 @@ paths:
                 $ref: '#/components/schemas/ErrorMessage'
           description: Not Implemented
       tags:
-        - dmi-datajob
+      - dmi-datajob
   /v1/cmwriteJob/dataProducer/{dataProducerId}/dataProducerJob/{dataProducerJobId}/result:
     get:
       description: Retrieve the result of a data job.
       operationId: getDataJobResult
       parameters:
-        - description: Identifier for the data producer
-          in: path
-          name: dataProducerId
-          required: true
-          schema:
-            example: some-data-producer-identifier
-            type: string
-          style: simple
-        - description: Identifier for the data producer job
-          in: path
-          name: dataProducerJobId
-          required: true
-          schema:
-            example: some-producer-job-identifier
-            type: string
-          style: simple
-        - description: Identifier for the data producer
-          in: query
-          name: dataProducerId
-          required: true
-          schema:
-            example: some-data-producer-identifier
-            type: string
-          style: form
-        - description: The destination of the results (Kafka topic name or s3 bucket
-            name)
-          in: query
-          name: destination
-          required: true
-          schema:
-            example: some-destination
-            type: string
-          style: form
+      - description: Identifier for the data producer
+        explode: false
+        in: path
+        name: dataProducerId
+        required: true
+        schema:
+          example: some-data-producer-identifier
+          type: string
+        style: simple
+      - description: Identifier for the data producer job
+        explode: false
+        in: path
+        name: dataProducerJobId
+        required: true
+        schema:
+          example: some-producer-job-identifier
+          type: string
+        style: simple
+      - description: The destination of the results (Kafka topic name or s3 bucket
+          name)
+        in: query
+        name: destination
+        required: true
+        schema:
+          example: some-destination
+          type: string
+        style: form
       responses:
         "501":
           content:
@@ -168,11 +156,12 @@ paths:
                 $ref: '#/components/schemas/ErrorMessage'
           description: Not Implemented
       tags:
-        - dmi-datajob
+      - dmi-datajob
 components:
   parameters:
     requestIdInPath:
       description: Identifier for the overall Datajob
+      explode: false
       in: path
       name: requestId
       required: true
@@ -182,6 +171,7 @@ components:
       style: simple
     dataProducerJobIdInPath:
       description: Identifier for the data producer job
+      explode: false
       in: path
       name: dataProducerJobId
       required: true
@@ -191,6 +181,7 @@ components:
       style: simple
     dataProducerIdInPath:
       description: Identifier for the data producer
+      explode: false
       in: path
       name: dataProducerId
       required: true
@@ -265,8 +256,8 @@ components:
             $ref: '#/components/schemas/SubjobReadRequest_data_inner'
           type: array
       required:
-        - data
-        - dataProducerId
+      - data
+      - dataProducerId
       type: object
     SubjobWriteRequest:
       properties:
@@ -285,7 +276,7 @@ components:
           type: string
         dataJobId:
           description: Identifier for the overall Data Job
-          example: my-data-job-identifier
+          example: my-data-producer-identifier
           type: string
         data:
           example:
@@ -299,8 +290,8 @@ components:
             $ref: '#/components/schemas/SubjobWriteRequest_data_inner'
           type: array
       required:
-        - data
-        - dataProducerId
+      - data
+      - dataProducerId
       type: object
     CmHandleProperties:
       description: Private properties of the cm handle for the given path
@@ -342,9 +333,9 @@ components:
           example: my-data-producer-identifier
           type: string
       required:
-        - dataProducerId
-        - dmiServiceName
-        - subJobId
+      - dataProducerId
+      - dmiServiceName
+      - subJobId
       type: object
     SubjobReadRequest_data_inner:
       properties:
@@ -396,16 +387,16 @@ components:
           description: Private properties of the cm handle for the given path
           type: object
       required:
-        - op
-        - path
+      - op
+      - path
       type: object
     SubjobWriteRequest_data_inner_value:
       description: Value dependent on the op specified. Resource for an add. Object
         for a replace. ActionParameters for an action.
       oneOf:
-        - $ref: '#/components/schemas/Resource'
-        - $ref: '#/components/schemas/ActionParameters'
-        - $ref: '#/components/schemas/Object'
+      - $ref: '#/components/schemas/Resource'
+      - $ref: '#/components/schemas/ActionParameters'
+      - $ref: '#/components/schemas/Object'
       type: object
     SubjobWriteRequest_data_inner:
       properties:
@@ -431,6 +422,6 @@ components:
         value:
           $ref: '#/components/schemas/SubjobWriteRequest_data_inner_value'
       required:
-        - op
-        - path
+      - op
+      - path
       type: object