Uploaded image for project: 'mod-inventory-storage'
  1. mod-inventory-storage
  2. MODINVSTOR-755

POST /item-storage/items error message on non-UUID statistical code ID

    XMLWordPrintable

Details

    • Core: Platform
    • Nolana R3 2022

    Description

      Overview

      Validate a POST request to /item-storage/items to reject statisticalCodeIds if they contain a string that isn't a UUID.
       
      Steps to Reproduce:

      1. POST /item-storage/items with the body containing an item with "statisticalCodeIds": [ "07"]

      Expected Results
      HTTP/1.1 422 Unprocessable Entity
      transfer-encoding: chunked
      Content-Type: application/json

      {"errors":[{"message":"elements in list must match pattern","type":"1","code":"elements in list must match pattern","parameters":[

      {"key":"statisticalCodeIds","value":"[07]"}

      ]}]}

      Actual Results
      HTTP/1.1 500 Internal Server Error
      transfer-encoding: chunked
      Content-Type: text/plain

      ERROR: invalid input syntax for type uuid: "07" (22P02)

      Note
      Fix HTTP status code, should be 422, not 500.
      Should mention statisticalCodeIds in error message.

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                julianladisch Julian Ladisch
                sduvvuri Sobha Duvvuri
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases