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

Patch Copy and Patch Move fail when the target property exists

    Details

      Description

      Patch "copy" and "Move" operations are documented in this section of the integrator's guide.
      They should work even when the target property exists, but currently they both fail.

      1) For Patch Copy

      • Create a user with properties mail and another_mail
        curl --header "If-None-Match: *" --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '{"userName": "rsutter", "telephoneNumber": "6669876987", "givenName": "rick", "description": "Just another user", "sn": "sutter", "mail": "rick@example.com", "password": "Th3Password", "another_mail": "whatever@already.there"}' --request PUT "http://localhost:8080/openidm/managed/user/ricksutter"
        
        {
          "_id": "ricksutter",
          "_rev": "00000000f06d16e3",
          "userName": "rsutter",
          "telephoneNumber": "6669876987",
          "givenName": "rick",
          "description": "Just another user",
          "sn": "sutter",
          "mail": "rick@example.com",
          "another_mail": "whatever@already.there",
          "accountStatus": "active",
          "lastChanged": {
            "date": "2018-01-10T21:31:46.426Z"
          },
          "effectiveRoles": [],
          "effectiveAssignments": []
        }
        
      • copy property mail to another_mail
        curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '[{"operation":"copy","from":"mail","field":"another_mail"}]' --request PATCH "http://localhost:8080/openidm/managed/user/ricksutter"
        {"code":500,"reason":"Internal Server Error","message":"/: Map key another_mail already exists"}
        

      2) for Patch Move

      • Create a user with properties source_property and target_property
        curl --header "If-None-Match: *" --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '{"userName": "rsutter", "telephoneNumber": "6669876987", "target_property": "anything", "givenName": "rick", "description": "Just another user", "sn": "sutter", "source_property": "whatever", "mail": "rick@example.com", "password": "Th3Password"}' --request PUT "http://localhost:8080/openidm/managed/user/ricksutter"
        {"_id":"ricksutter","_rev":"00000000fbbf0972","userName":"rsutter","telephoneNumber":"6669876987","target_property":"anything","givenName":"rick","description":"Just another user","sn":"sutter","source_property":"whatever","mail":"rick@example.com","accountStatus":"active","lastChanged":{"date":"2017-10-09T14:26:07.012Z"},"effectiveRoles":[],"effectiveAssignments":[]}
        
      • copy property source_property to target_property
        curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '[{"operation":"move","from":"source_property","field":"target_property"}]' --request PATCH "http://localhost:8080/openidm/managed/user/ricksutter"
        {"code":500,"reason":"Internal Server Error","message":"/: Map key target_property already exists"}
        

        Attachments

          Activity

            People

            • Assignee:
              travis.haagen Travis Haagen
              Reporter:
              laurent.bristiel Laurent Bristiel [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: