Uploaded image for project: 'OpenICF'
  1. OpenICF
  2. OPENICF-1154

DataBase Table Connector: rest query on remote endpoint with id as a string returns HTTP 400

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: databasetable-connector-1.4.2.0
    • Environment:
      OpenIDM version "7.0.0-SNAPSHOT" (build: 20190730214852, revision: a169405)
      databasetable-connector-1.4.2.0-SNAPSHOT (SCM-Revision: 1ec8540333a13a241beaefcaa0b45e256eac8aab)

      Description

      We have found a new issue when running the latest CI tests where test 'get_on_system_nonexisting_user' is failing https://ci.forgerock.org/job/IDM-7.0.x/job/icf_connectors_linux/279//robot/report/report.html#totals?critical

      When we run a curl command with query for non-existing id as a string it returns HTTP 400 "Bad request" error instead of expected HTTP 404 "Not found".

      curl request:

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin"  --request GET "http://localhost:8080/openidm/system/contractordb/__ACCOUNT__/undefined"
      

      json response:

      {
        "code": 400,
        "reason": "Bad Request",
        "message": "For input string: \"undefined\""
      }
      

      When we run the same curl command for non-existing id as an integer it returns correctly HTTP 404 "Not found" as expected.

      curl request:

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin"  --request GET "http://localhost:8080/openidm/system/contractordb/__ACCOUNT__/999999"
      

      json response:

      {
        "code":404,
        "reason":"Not Found",
        "message":"Object 999999 not found on system/contractordb"
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                petr.jurica Petr Jurica [X] (Inactive)
                Reporter:
                son.nguyen Son Nguyen
                QA Assignee:
                Son Nguyen
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: