Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-15058

Able to create duplicate array entries using REST



    • Bug
    • Status: Closed
    • Major
    • Resolution: Not a defect
    • None


      Steps to reproduce


      1. Install (reproduced on as well)
      2. Ran with ./startup.sh -p sample/sync-with-csv. You can use whatever you feel like
      3. Go to Configure > Managed Objects and edit the User
      4. Add a testArray, label “Test Array” and for type, select Array and keep the defaults for advance options except for Searchable so you are able to see values in User List view
      5. Click Manage > User and Add a user.  I created test1 as an example and save
      6. Edit the user and add entries into the array.  I added two values: 1 & 2
      7. I see them in User List view. Test Array shows as 1, 2
      8. Go back and edit user and change the value for 2 in the array to a 1. So we should see 1, 1.  What happens is when you hit save, you are left with only 1 value in the array.  Admin UI keeps the values in the array unique

      Next we use REST to patch the user:

      1). Patch:

      2) payload:


      {      "operation": "add",      "field": "/testArray/-",      "value": "2"    }


      3) result:

          "testArray": [





      4) rerun the patch and get the following results

       "testArray": [





      Note that I can add as many values of the same thing.  If I go back to User List, I will see 1, 2, 2 for Test Array.  We should not be allowing duplicates.  It should work the same as in the UI.




            brmiller Brendan Miller
            jesse.ontiveros Jesse Ontiveros
            0 Vote for this issue
            2 Start watching this issue