Add Examples to DMI-Plugin API Spec

Issue-ID: CPS-784
Signed-off-by: lukegleeson <luke.gleeson@est.tech>
Change-Id: I02e450c9c14322fa9c9ac3e14807aeebdb4b9e39
diff --git a/openapi/components.yml b/openapi/components.yml
index cdf4c1c..aa0827a 100644
--- a/openapi/components.yml
+++ b/openapi/components.yml
@@ -16,6 +16,7 @@
       properties:
         cmHandles:
           type: array
+          example: ["cmHandleId1","cmHandleId2","cmHandleId3"]
           items:
             type: string
 
@@ -37,9 +38,11 @@
                 type: object
                 properties:
                   name:
-                    $ref: '#/components/schemas/name'
+                    type: string
+                    example: my-name
                   revision:
-                    $ref: '#/components/schemas/revision'
+                    type: string
+                    example: my-revision
         cmHandleProperties:
           $ref: '#/components/schemas/cmHandleProperties'
 
@@ -53,10 +56,13 @@
             properties:
               moduleName:
                 type: string
+                example: my-module-name
               revision:
-                $ref: '#/components/schemas/revision'
+                type: string
+                example: my-revision
               namespace:
                 type: string
+                example: my-namespace
 
     YangResources:
       type: array
@@ -68,10 +74,13 @@
       properties:
         yangSource:
           type: string
+          example: my-yang-source
         moduleName:
           type: string
+          example: my-module-name
         revision:
-          $ref: '#/components/schemas/revision'
+          type: string
+          example: my-revision
 
     DataAccessRequest:
       type: object
@@ -79,10 +88,13 @@
         operation:
           type: string
           enum: [ read, create, update, delete ]
+          example: read
         dataType:
           type: string
+          example: my-data-type
         data:
           type: string
+          example: my-data
         cmHandleProperties:
           $ref: '#/components/schemas/cmHandleProperties'
 
@@ -92,60 +104,60 @@
         type: string
         example: {"prop1":"value1","prop2":"value2"}
 
-    name:
-      type: string
-      example: someName
-
-    revision:
-      type: string
-      example: someRevision
-
   responses:
-    NotFound:
-      description: The specified resource was not found
-      content:
-        application/json:
-          schema:
-            $ref: '#/components/schemas/ErrorMessage'
-    Unauthorized:
-      description: Unauthorized
-      content:
-        application/json:
-          schema:
-            $ref: '#/components/schemas/ErrorMessage'
-    Forbidden:
-      description: Forbidden
-      content:
-        application/json:
-          schema:
-            $ref: '#/components/schemas/ErrorMessage'
+    NoContent:
+      description: No Content
+      content: {}
     BadRequest:
       description: Bad Request
       content:
         application/json:
           schema:
             $ref: '#/components/schemas/ErrorMessage'
+          example:
+            status: 400
+            message: Bad Request
+            details: The provided request is not valid
+    Unauthorized:
+      description: Unauthorized
+      content:
+        application/json:
+          schema:
+            $ref: '#/components/schemas/ErrorMessage'
+          example:
+            status: 401
+            message: Unauthorized request
+            details: This request is unauthorized
+    Forbidden:
+      description: Forbidden
+      content:
+        application/json:
+          schema:
+            $ref: '#/components/schemas/ErrorMessage'
+          example:
+            status: 403
+            message: Request Forbidden
+            details: This request is forbidden
+    NotFound:
+      description: The specified resource was not found
+      content:
+        application/json:
+          schema:
+            $ref: '#/components/schemas/ErrorMessage'
+          example:
+            status: 404
+            message: Resource Not Found
+            details: The requested resource is not found
     Conflict:
       description: Conflict
       content:
         application/json:
           schema:
             $ref: '#/components/schemas/ErrorMessage'
-    Ok:
-      description: OK
-      content:
-        application/json:
-          schema:
-            type: object
-    Created:
-      description: Created
-      content:
-        text/plain:
-          schema:
-            type: string
-    NoContent:
-      description: No Content
-      content: {}
+          example:
+            status: 409
+            message: Conflicting request
+            details: The request cannot be processed as the resource is in use.
 
   parameters:
     cmHandleInPath:
@@ -155,6 +167,7 @@
       required: true
       schema:
         type: string
+        example: my-cm-handle
 
     resourceIdentifierInQuery:
       name: resourceIdentifier
@@ -164,6 +177,7 @@
       allowReserved: true
       schema:
         type: string
+        example: my-schema:my-node
 
     acceptParamInHeader:
       name: accept
@@ -190,4 +204,4 @@
             options: (key1=value1,key2=value1/value2)
         sample3:
           value:
-            options: (key1=10,key2=value2,key3=[val31,val32])
\ No newline at end of file
+            options: (key1=10,key2=value2,key3=val31,val32)
\ No newline at end of file