Changing variable types for api
authorniamhcore <niamh.core@est.tech>
Tue, 27 Oct 2020 15:49:30 +0000 (15:49 +0000)
committerniamhcore <niamh.core@est.tech>
Wed, 28 Oct 2020 16:37:41 +0000 (16:37 +0000)
Link: https://jira.onap.org/browse/CCSDK-2907
Issue-ID: CCSDK-2907

Change-Id: Ib473370222b1e5b2c27f4a6bcf01b2d8ef523c9b

cps/cps-rest/docs/api/swagger/openapi.yml
cps/cps-rest/src/main/java/org/onap/cps/rest/controller/RestController.java

index 1f9019a..f116c26 100644 (file)
@@ -21,8 +21,7 @@ paths:
           description: dataspace-name
           required: true
           schema:
-            type: integer
-            format: int32
+            type: string
       responses:
         200:
           description: OK
@@ -51,8 +50,7 @@ paths:
           description: dataspace-name
           required: true
           schema:
-            type: integer
-            format: int32
+            type: string
       responses:
         200:
           description: OK
@@ -80,8 +78,7 @@ paths:
           description: dataspace-name
           required: true
           schema:
-            type: integer
-            format: int32
+            type: string
       requestBody:
         content:
           multipart/form-data:
@@ -125,15 +122,13 @@ paths:
           description: dataspace-name
           required: true
           schema:
-            type: integer
-            format: int32
+            type: string
         - name: anchor-name
           in: path
           description: anchor-name
           required: true
           schema:
-            type: integer
-            format: int32
+            type: string
       responses:
         200:
           description: OK
@@ -161,15 +156,13 @@ paths:
           description: dataspace-name
           required: true
           schema:
-            type: integer
-            format: int32
+            type: string
         - name: anchor-name
           in: path
           description: anchor-name
           required: true
           schema:
-            type: integer
-            format: int32
+            type: string
       responses:
         200:
           description: OK
@@ -193,20 +186,18 @@ paths:
       summary: Get a node given an anchor for the given dataspace
       operationId: getNodeByDataspaceAndAnchor
       parameters:
-        - name: dataspaceName
+        - name: dataspace-name
           in: path
-          description: dataspaceName
+          description: dataspace-name
           required: true
           schema:
-            type: integer
-            format: int32
-        - name: anchorpoint
+            type: string
+        - name: anchor-name
           in: path
-          description: anchorpoint
+          description: anchor-name
           required: true
           schema:
-            type: integer
-            format: int32
+            type: string
       requestBody:
         description: xpath
         content:
@@ -238,25 +229,22 @@ paths:
       summary: Read all yang modules in the store
       operationId: getModule
       parameters:
-        - name: dataspaceName
+        - name: dataspace-name
           in: path
-          description: dataspaceName
+          description: dataspace-name
           required: true
           schema:
-            type: integer
-            format: int32
+            type: string
         - name: namespace-name
           in: query
           description: namespace-name
           schema:
-            type: integer
-            format: int32
+            type: string
         - name: revision
           in: query
           description: revision
           schema:
-            type: integer
-            format: int32
+            type: string
       responses:
         200:
           description: OK
@@ -284,8 +272,7 @@ paths:
           description: dataspace-name
           required: true
           schema:
-            type: integer
-            format: int32
+            type: string
       requestBody:
         content:
           multipart/form-data:
@@ -324,13 +311,12 @@ paths:
       summary: Get all nodes for a given dataspace using an xpath or schema node identifier
       operationId: getNode
       parameters:
-        - name: dataspaceName
+        - name: dataspace-name
           in: path
-          description: dataspaceName
+          description: dataspace-name
           required: true
           schema:
-            type: integer
-            format: int32
+            type: string
       requestBody:
         description: requestBody
         content:
@@ -366,8 +352,7 @@ paths:
           description: dataspace-name
           required: true
           schema:
-            type: integer
-            format: int32
+            type: string
       requestBody:
         content:
           multipart/form-data:
@@ -399,4 +384,4 @@ paths:
         404:
           description: Not Found
           content: {}
-components: {}
+components: {}
\ No newline at end of file
index 703e778..d3ff91b 100644 (file)
@@ -51,52 +51,53 @@ public class RestController implements CpsResourceApi {
     private CpService cpService;
 
     @Override
-    public Object createAnchor(Attachment fileDetail, Integer dataspaceName) {
+    public Object createAnchor(final Attachment fileDetail, final String dataspaceName) {
         return null;
     }
 
     @Override
-    public Object createModules(Attachment fileDetail, Integer dataspaceName) {
+    public Object createModules(final Attachment fileDetail, final String dataspaceName) {
         return null;
     }
 
     @Override
-    public Object createNode(Attachment fileDetail, Integer dataspaceName) {
+    public Object createNode(final Attachment fileDetail, final String dataspaceName) {
         return null;
     }
 
     @Override
-    public Object deleteAnchor(Integer dataspaceName, Integer anchorName) {
+    public Object deleteAnchor(final String dataspaceName, final String anchorName) {
         return null;
     }
 
     @Override
-    public Object deleteDataspace(Integer dataspaceName) {
+    public Object deleteDataspace(final String dataspaceName) {
         return null;
     }
 
     @Override
-    public Object getAnchor(Integer dataspaceName, Integer anchorName) {
+    public Object getAnchor(final String dataspaceName, final String anchorName) {
         return null;
     }
 
     @Override
-    public Object getAnchors(Integer dataspaceName) {
+    public Object getAnchors(final String dataspaceName) {
         return null;
     }
 
     @Override
-    public Object getModule(Integer dataspaceName, Integer namespaceName, Integer revision) {
+    public Object getModule(final String dataspaceName, final String namespaceName, final String revision) {
         return null;
     }
 
     @Override
-    public Object getNode(@Valid String body, Integer dataspaceName) {
+    public Object getNode(@Valid final String body, final String dataspaceName) {
         return null;
     }
 
     @Override
-    public Object getNodeByDataspaceAndAnchor(@Valid String body, Integer dataspaceName, Integer anchorpoint) {
+    public Object getNodeByDataspaceAndAnchor(@Valid final String body, final String dataspaceName,
+        final String anchorName) {
         return null;
     }
 
@@ -139,7 +140,7 @@ public class RestController implements CpsResourceApi {
     @Path("/upload-yang-json-data-file")
     @Produces(MediaType.APPLICATION_JSON)
     @Consumes(MediaType.MULTIPART_FORM_DATA)
-    public final Response uploadYangJsonDataFile(@FormDataParam("file") String uploadedFile) {
+    public final Response uploadYangJsonDataFile(@FormDataParam("file") final String uploadedFile) {
         try {
             validateJsonStructure(uploadedFile);
             final int persistenceObjectId = cpService.storeJsonStructure(uploadedFile);
@@ -160,7 +161,7 @@ public class RestController implements CpsResourceApi {
      */
     @GET
     @Path("/json-object/{id}")
-    public final Response getJsonObjectById(@PathParam("id") int jsonObjectId) {
+    public final Response getJsonObjectById(@PathParam("id") final int jsonObjectId) {
         try {
             return Response.status(Status.OK).entity(cpService.getJsonById(jsonObjectId)).build();
         } catch (final PersistenceException e) {
@@ -178,7 +179,7 @@ public class RestController implements CpsResourceApi {
      */
     @DELETE
     @Path("json-object/{id}")
-    public final Response deleteJsonObjectById(@PathParam("id") int jsonObjectId) {
+    public final Response deleteJsonObjectById(@PathParam("id") final int jsonObjectId) {
         try {
             cpService.deleteJsonById(jsonObjectId);
             return Response.status(Status.OK).entity(Status.OK.toString()).build();
@@ -194,7 +195,7 @@ public class RestController implements CpsResourceApi {
         gson.fromJson(jsonFile, Object.class);
     }
 
-    private static final File renameFileIfNeeded(File originalFile) {
+    private static final File renameFileIfNeeded(final File originalFile) {
         if (originalFile.getName().endsWith(".yang")) {
             return originalFile;
         }