Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-422

REST 404 response returned instead of 400 for POST/PUT/PATCH request types

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • Istanbul Release
    • Honolulu Release
    • CPS-Core-REST
    • None

      When update operations are performed on a data fragment (list node element) the parent node xpath parameter is passed to identify the parent node of a fragment being updated.

      If parent node is not found in the database the DataNodeNotFoundExeption is thrown and it causes 404 (Not Fount) response. At the same if there is no requested dataspace or anchor being found in database, the 400 (Bad Request) response is returned, indicating invalid request parameters. So the response is being inconsistent for errors having similar nature.

      Actual:

      404 response is returned for any request type if DataNodeNotFoundException occurs

      Expected:

      if parent data node is not found on POST/PUT/PATCH request method types, the 400 (Bad Request) response should be returned instead of 404. 404 is only expected for GET requests.

       

            rkashapov rkashapov
            rkashapov rkashapov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: