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

With an embedded DS repo, PATCH remove on a null value does not delete the property

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: OpenIDM 6.0.0
    • Fix Version/s: 6.5.0
    • Component/s: None
    • Environment:
      OpenIDM 6.0.0-SNAPSHOT (2a2f463),
      mysql 5.7, opendj-6.0.0-M120.7
    • Target Version/s:
    • Verified Version/s:
    • Story Points:
      1
    • Sprint:
      OpenIDM Sprint 90, OpenIDM Sprint 6.5-10.1

      Description

      Patch with operation remove on attribute which has null value is supposed to be removed according to OPENIDM-8722

      This does not happen for the embedded DJ. The property remains in the object with null value.

      For other repo types it deletes the property.

      Create user:

      curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '\{ "userName": "user_with_property_set_to_null", "givenName": "no", "sn": "country", "mail": "user@mail.com", "prop_to_remove": null }' --request POST "http://localhost:8080/openidm/managed/user?_action=create" 
      Response Content: \{"_id":"ea0c4477-47a0-4069-af39-300500c72b61","_rev":"00000000dbd18b50","userName":"user_with_property_set_to_null","givenName":"no","sn":"country","mail":"user@mail.com","prop_to_remove":null,"accountStatus":"active","effectiveRoles":[],"effectiveAssignments":[]}
      

      embedded dj - property remains:

      curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '[\{"operation":"remove","field":"prop_to_remove"}]' --request PATCH "http://localhost:8080/openidm/managed/user/ea0c4477-47a0-4069-af39-300500c72b61" 
      Response Content: \{"_id":"ea0c4477-47a0-4069-af39-300500c72b61","_rev":"00000000dbd18b50","userName":"user_with_property_set_to_null","givenName":"no","sn":"country","mail":"user@mail.com","prop_to_remove":null,"accountStatus":"active","effectiveRoles":([],"effectiveAssignments":[]}

      external dj - property is deleted:

      curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '[\{"operation":"remove","field":"prop_to_remove"}]' --request PATCH "http://localhost:8080/openidm/managed/user/bd480068-402b-4ea1-b072-757c18a18765" 
      Response Content: \{"_id":"bd480068-402b-4ea1-b072-757c18a18765","_rev":"00000000a74299cf","userName":"user_with_property_set_to_null","givenName":"no","sn":"country","mail":"user@mail.com","accountStatus":"active","effectiveRoles":[],"effectiveAssignments":[]}
      

      mysql - property is deleted:

      curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '[\{"operation":"remove","field":"prop_to_remove"}]' --request PATCH "http://localhost:8080/openidm/managed/user/24795f7e-dc4c-4805-b260-073abb6e3f62" 
      Response Content: \{"_id":"24795f7e-dc4c-4805-b260-073abb6e3f62","_rev":"1","userName":"user_with_property_set_to_null","givenName":"no","sn":"country","mail":"user@mail.com","accountStatus":"active","effectiveRoles":([],"effectiveAssignments":[]}
      

      mysql explicit table - property is deleted:

      curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '[\{"operation":"remove","field":"prop_to_remove"}]' --request PATCH "http://localhost:8080/openidm/managed/user/7de56682-3e52-419a-b0a1-fa256d01cc2a" 
      Response Content: \{"_id":"7de56682-3e52-419a-b0a1-fa256d01cc2a","_rev":"1","effectiveRoles":[],"effectiveAssignments":([],"mail":"user@mail.com","userName":"user_with_property_set_to_null","givenName":"no","accountStatus":"active","sn":"country"}
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jim.mitchener Jim Mitchener
                Reporter:
                Ladislav.Folta Ladislav Folta
                QA Assignee:
                Ladislav Folta
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: