summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ncmp-rest')
-rw-r--r--cps-ncmp-rest/docs/openapi/components.yaml44
-rwxr-xr-xcps-ncmp-rest/docs/openapi/ncmp.yml4
-rwxr-xr-xcps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java4
3 files changed, 48 insertions, 4 deletions
diff --git a/cps-ncmp-rest/docs/openapi/components.yaml b/cps-ncmp-rest/docs/openapi/components.yaml
index d9bd49a097..e63f9c0b84 100644
--- a/cps-ncmp-rest/docs/openapi/components.yaml
+++ b/cps-ncmp-rest/docs/openapi/components.yaml
@@ -151,6 +151,50 @@ components:
- authors:
- Philip Pullman
+ dataSamplePatchRequest:
+ summary: Sample patch request
+ description: Sample patch request body
+ value:
+ ietf-restconf:yang-patch:
+ patch-id: patch-1
+ edit:
+ - edit-id: edit1
+ operation: merge
+ target: /
+ value:
+ test:bookstore:
+ bookstore-name: Chapters
+ categories:
+ - code: '01'
+ name: Science
+ books:
+ - authors:
+ - Author1
+ - Author2
+ - code: '02'
+ name: Arts
+ books:
+ - authors:
+ - Author3
+ - edit-id: edit2
+ operation: merge
+ target: /
+ value:
+ test:bookstore:
+ bookstore-name: Novels
+ categories:
+ - code: '03'
+ name: History
+ books:
+ - authors:
+ - Iain M. Banks
+ - Ursula K. Le Guin
+ - code: '04'
+ name: Fiction
+ books:
+ - authors:
+ - Philip Pullman
+
dataSampleResponse:
summary: Sample response
description: Sample response for selecting 'sample 1'.
diff --git a/cps-ncmp-rest/docs/openapi/ncmp.yml b/cps-ncmp-rest/docs/openapi/ncmp.yml
index 7845a34ad6..75a5295042 100755
--- a/cps-ncmp-rest/docs/openapi/ncmp.yml
+++ b/cps-ncmp-rest/docs/openapi/ncmp.yml
@@ -340,12 +340,12 @@ resourceDataForPassthroughRunning:
requestBody:
required: true
content:
- application/json:
+ '*/*':
schema:
type: object
examples:
dataSampleRequest:
- $ref: 'components.yaml#/components/examples/dataSampleRequest'
+ $ref: 'components.yaml#/components/examples/dataSamplePatchRequest'
responses:
200:
$ref: 'components.yaml#/components/responses/Ok'
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
index e3c457eaf4..a6b09e845c 100755
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
@@ -204,9 +204,9 @@ public class NetworkCmProxyController implements NetworkCmProxyApi {
public ResponseEntity<Object> patchResourceDataRunningForCmHandle(final String resourceIdentifier,
final String cmHandle,
final Object requestBody, final String contentType) {
- networkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle(cmHandle,
+ final Object responseObject = networkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle(cmHandle,
resourceIdentifier, PATCH, GSON.toJson(requestBody), contentType);
- return new ResponseEntity<>(HttpStatus.OK);
+ return ResponseEntity.ok(responseObject);
}
/**