summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiamh Core <niamh.core@est.tech>2021-07-21 13:27:34 +0000
committerGerrit Code Review <gerrit@onap.org>2021-07-21 13:27:34 +0000
commit187c8c84dcfa347ba3475a36c73b36ef59874655 (patch)
treec1595b43b2fb669e5e2677f746c04d766be2fb8a
parentf0527c58c17963d940535d0ce0eb934c2b4c635c (diff)
parent2472e61ecf2f5ebf9c5e3ddcf9c2b66ab0d4219e (diff)
Merge "CPS-401 Update Open API YAML with data types and example for output (cpsData)"
-rw-r--r--cps-application/src/main/resources/application.yml5
-rwxr-xr-xcps-rest/pom.xml7
-rw-r--r--cps-rest/src/main/resources/static/components.yml (renamed from cps-rest/docs/openapi/components.yml)1
-rw-r--r--cps-rest/src/main/resources/static/cpsAdmin.yml (renamed from cps-rest/docs/openapi/cpsAdmin.yml)0
-rw-r--r--cps-rest/src/main/resources/static/cpsData.yml (renamed from cps-rest/docs/openapi/cpsData.yml)7
-rw-r--r--cps-rest/src/main/resources/static/cpsQuery.yml (renamed from cps-rest/docs/openapi/cpsQuery.yml)0
-rw-r--r--cps-rest/src/main/resources/static/openapi.yml (renamed from cps-rest/docs/openapi/openapi.yml)2
7 files changed, 19 insertions, 3 deletions
diff --git a/cps-application/src/main/resources/application.yml b/cps-application/src/main/resources/application.yml
index 1b62b02df..ac620f6cb 100644
--- a/cps-application/src/main/resources/application.yml
+++ b/cps-application/src/main/resources/application.yml
@@ -73,6 +73,11 @@ notification:
enabled: false
topic: ${CPS_CHANGE_EVENT_TOPIC:cps.cfg-state-events}
+springdoc:
+ swagger-ui:
+ url: /openapi.yml
+ path: /swagger-ui/index.html
+
security:
# comma-separated uri patterns which do not require authorization
permit-uri: /manage/**,/swagger-ui/**,/swagger-resources/**,/v3/api-docs
diff --git a/cps-rest/pom.xml b/cps-rest/pom.xml
index 4b42656e8..9a131176d 100755
--- a/cps-rest/pom.xml
+++ b/cps-rest/pom.xml
@@ -75,6 +75,11 @@
<artifactId>swagger-annotations</artifactId>
</dependency>
<dependency>
+ <groupId>org.springdoc</groupId>
+ <artifactId>springdoc-openapi-ui</artifactId>
+ <version>1.5.9</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
@@ -133,7 +138,7 @@
<goal>generate</goal>
</goals>
<configuration>
- <inputSpec>${project.basedir}/docs/openapi/openapi.yml</inputSpec>
+ <inputSpec>${project.basedir}/src/main/resources/static/openapi.yml</inputSpec>
<invokerPackage>org.onap.cps.rest.controller</invokerPackage>
<modelPackage>org.onap.cps.rest.model</modelPackage>
<apiPackage>org.onap.cps.rest.api</apiPackage>
diff --git a/cps-rest/docs/openapi/components.yml b/cps-rest/src/main/resources/static/components.yml
index 6543fcab6..51a49a6e9 100644
--- a/cps-rest/docs/openapi/components.yml
+++ b/cps-rest/src/main/resources/static/components.yml
@@ -196,6 +196,7 @@ components:
application/json:
schema:
type: object
+ example: { "key": "value" }
Created:
description: Created
content:
diff --git a/cps-rest/docs/openapi/cpsAdmin.yml b/cps-rest/src/main/resources/static/cpsAdmin.yml
index 35b2e4ca6..35b2e4ca6 100644
--- a/cps-rest/docs/openapi/cpsAdmin.yml
+++ b/cps-rest/src/main/resources/static/cpsAdmin.yml
diff --git a/cps-rest/docs/openapi/cpsData.yml b/cps-rest/src/main/resources/static/cpsData.yml
index fb21f757a..7e9f71d62 100644
--- a/cps-rest/docs/openapi/cpsData.yml
+++ b/cps-rest/src/main/resources/static/cpsData.yml
@@ -28,7 +28,12 @@ nodeByDataspaceAndAnchor:
- $ref: 'components.yml#/components/parameters/includeDescendantsOptionInQuery'
responses:
'200':
- $ref: 'components.yml#/components/responses/Ok'
+ description: OK
+ content:
+ application/json:
+ schema:
+ type: object
+ example: { "child": my_child,"leafList": "leafListElement1, leafListElement2", "leaf": my_leaf }
'400':
$ref: 'components.yml#/components/responses/BadRequest'
'401':
diff --git a/cps-rest/docs/openapi/cpsQuery.yml b/cps-rest/src/main/resources/static/cpsQuery.yml
index f45f3f41a..f45f3f41a 100644
--- a/cps-rest/docs/openapi/cpsQuery.yml
+++ b/cps-rest/src/main/resources/static/cpsQuery.yml
diff --git a/cps-rest/docs/openapi/openapi.yml b/cps-rest/src/main/resources/static/openapi.yml
index caaad68b6..8fa640cf9 100644
--- a/cps-rest/docs/openapi/openapi.yml
+++ b/cps-rest/src/main/resources/static/openapi.yml
@@ -35,7 +35,7 @@ info:
url: "cps_logo.png"
servers:
- - url: //localhost:8088
+ - url: /cps/api
tags:
- name: cps-admin
description: cps Admin