Fix "Create a node" and "Add List Elements" APIs response code 68/138268/5
authorArpit Singh <as00745003@techmahindra.com>
Wed, 17 Jul 2024 04:54:44 +0000 (10:24 +0530)
committerPriyank Maheshwari <priyank.maheshwari@est.tech>
Wed, 24 Jul 2024 09:28:21 +0000 (09:28 +0000)
Create a node and Add list elements APIs would return a 500 response
code when a JSON payload mismatching the Schema was sent as part of
the request body.

Updated the code to return response code 400.

Issue-ID: CPS-2319
Change-Id: I86d6af446966790d9e45045b330f0c411fcd0f1d
Signed-off-by: Arpit Singh <as00745003@techmahindra.com>
cps-rest/docs/openapi/components.yml
cps-rest/docs/openapi/cpsData.yml

index 99502e3..a2587eb 100644 (file)
@@ -376,7 +376,7 @@ components:
     Created:
       description: Created
       content:
-        text/plain:
+        application/json:
           schema:
             type: string
             example: my-resource
index 80d07c8..1e70ef6 100644 (file)
@@ -112,7 +112,6 @@ nodesByDataspaceAndAnchor:
           examples:
             dataSample:
               $ref: 'components.yml#/components/examples/dataSampleXml'
-
     responses:
       '201':
         $ref: 'components.yml#/components/responses/Created'