diff options
author | JosephKeenan <joseph.keenan@est.tech> | 2021-06-23 14:15:52 +0100 |
---|---|---|
committer | JosephKeenan <joseph.keenan@est.tech> | 2021-07-16 14:58:31 +0100 |
commit | 2472e61ecf2f5ebf9c5e3ddcf9c2b66ab0d4219e (patch) | |
tree | ed7c5017a0ef4104dece1cc562f42063b419d815 | |
parent | b81d0407c3f3356057bd1a8d66aadc42270becfe (diff) |
CPS-401 Update Open API YAML with data types and example for output (cpsData)
-added response for get data nodes based on dataspace and anchor
-modified modelmapper jn DataRestControllerSpec to be Spy not Mock
-when openapi.yaml is entered into https://editor.swagger.io/ it
displays however locally it does not, This may be due to file
segmentation but this is still unclear.
-moved files from docs/openapi to src/main/resources/static as required
for new swagger sprindoc
Issue-ID: CPS-401
Change-Id: I45286530d9a9ca85b56c0a656a44675398a003f4
Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
-rw-r--r-- | cps-application/src/main/resources/application.yml | 5 | ||||
-rwxr-xr-x | cps-rest/pom.xml | 7 | ||||
-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 1b62b02df5..ac620f6cb3 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 4b42656e89..9a131176db 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 6543fcab6d..51a49a6e9f 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 35b2e4ca6a..35b2e4ca6a 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 fb21f757a0..7e9f71d62b 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 f45f3f41ae..f45f3f41ae 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 caaad68b60..8fa640cf9b 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 |