Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-1862

PATCH on more then one attribute is broken, correct syntax is also not documented

    Details

    • Type: Bug
    • Status: Done
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 2.6.2
    • Fix Version/s: 3.0.0, 2.8.0
    • Component/s: documentation, rest
    • Labels:
      None
    • Environment:
      Any

      Description

      I trying to update two attributes using REST and PATCH. There is currently no documentation on syntax on how this can be done for more then one attribute. I found a syntax that was excepted by OpenDJ, but both fields were set the value of the last 'value' argument. Then tried two REST PATCH call in a sequence for each field, and the result was the same. The first PATCH field was also updated with the value of the second/last PATCH call.

      Updating both fields:

      curl - updating both fields
      curl --user tward:Passw0rd 
        --request PATCH 
        --header 'Content-Type: application/json' 
        --data '[
           {"operation": "replace","field": "preferredLanguage","value": "A-Value"}, 
           {"operation": "replace","field": "description","value": "B-Value"}
         ]' 'http://localhost:5080/users/tward?_prettyPrint=true'
      

      Updating the fields one by one, first 'preferredLanguage'

      curl - updating only 'preferredLanguage'
      curl --user tward:Passw0rd 
        --request PATCH 
        --header 'Content-Type: application/json' 
        --data '[
           {"operation": "replace","field": "preferredLanguage","value": "ApreferredLanguage"}
          ]' 'http://localhost:5080/users/tward?_prettyPrint=true'
      
      curl - then updating only 'description'
      curl --user tward:Passw0rd 
        --request PATCH 
        --header 'Content-Type: application/json' 
        --data '[
           {"operation":"replace","field": "description","value": "Bdescription"}
         ]' 'http://localhost:5080/users/tward?_prettyPrint=true'
      

      Added description to the http-config.json

      "description" : { "simple": { "ldapAttribute" : "description", "isSingleValued" : true} },
      

        Attachments

          Activity

            People

            • Assignee:
              Mark Mark Craig
              Reporter:
              stein Stein Myrseth
              Dev Assignee:
              Mark Craig
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: