From 996152ac6467946e567ca4e76ce78cc3a3ee0371 Mon Sep 17 00:00:00 2001 From: lukegleeson Date: Tue, 30 Nov 2021 17:06:03 +0000 Subject: Add Examples to DMI-Plugin API Spec Issue-ID: CPS-784 Signed-off-by: lukegleeson Change-Id: I02e450c9c14322fa9c9ac3e14807aeebdb4b9e39 --- openapi/openapi.yml | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) (limited to 'openapi/openapi.yml') diff --git a/openapi/openapi.yml b/openapi/openapi.yml index 5c095a7a..6605a2df 100644 --- a/openapi/openapi.yml +++ b/openapi/openapi.yml @@ -39,12 +39,7 @@ paths: description: Get all modules for given cm handle operationId: getModuleReferences parameters: - - name: cmHandle - in: path - description: The cm handle to fetch all the modules - required: true - schema: - type: string + - $ref: 'components.yml#/components/parameters/cmHandleInPath' requestBody: description: Operational body content: @@ -58,15 +53,6 @@ paths: application/json: schema: $ref: 'components.yml#/components/schemas/ModuleSet' - example: { - "schemas": [ - { - "moduleName": "example-identifier", - "revision": "example-version", - "namespace": "example-namespace" - } - ] - } '400': $ref: 'components.yml#/components/responses/BadRequest' '401': @@ -120,7 +106,12 @@ paths: required: true responses: '201': - $ref: 'components.yml#/components/responses/Created' + description: Created + content: + text/plain: + schema: + type: string + example: cm-handle registered successfully '400': $ref: 'components.yml#/components/responses/BadRequest' '401': @@ -148,7 +139,15 @@ paths: $ref: 'components.yml#/components/schemas/DataAccessRequest' responses: '200': - $ref: 'components.yml#/components/responses/Ok' + description: OK + content: + application/json: + schema: + type: object + example: + - yangSource: my-yang-source + moduleName: my-module-name + revision: my-revision '400': $ref: 'components.yml#/components/responses/BadRequest' '401': @@ -175,7 +174,20 @@ paths: $ref: 'components.yml#/components/schemas/DataAccessRequest' responses: '201': - $ref: 'components.yml#/components/responses/Created' + description: Created + content: + text/plain: + schema: + type: string + examples: + Read: + value: + - yangSource: my-yang-source + moduleName: my-module-name + revision: my-revision + Write: + value: "Created Resource Name" + '400': $ref: 'components.yml#/components/responses/BadRequest' '401': -- cgit 1.2.3-korg