jasonfagerberg-toast opened a new issue, #725:
URL: https://github.com/apache/directory-scimple/issues/725

   The `DefaultPatchHandler` incorrectly replaces omitted fields with `null` 
for complex objects such as `name`.
   
   For the given request
   
   ```json
   {
     "schemas": [
       "urn:ietf:params:scim:api:messages:2.0:PatchOp"
     ],
     "Operations": [
       {
         "op": "replace",
         "value": {
           "name": {
             "givenName": "New Given Name"
           }
         }
       }
     ]
   }
   ```
   
   the expected output should be
   
   ```json
   {
       "givenName": "New Given Name",
       "familyName": "Existing Family Name"
   }
   ```
   
   However, `DefaultPatchHandler` replaces `familyName` with `null`
   
   ```
   {
       "givenName": "New Given Name",
       "familyName": null
   }
   ```
   
   I believe this is because `DefaultPatchHandler.applySingleValue` is 
replacing `User.name` with the entirety of the request instead of merging the 
existing with the request
   
   <img width="1272" alt="Image" 
src="https://github.com/user-attachments/assets/3a34489e-b046-48f8-bed4-fc8a3de47e7a";
 />
   
   According to the [SCIM 
RFC](https://datatracker.ietf.org/doc/html/rfc7644#section-3.5.2.3)
   
   >    o  If the target location specifies a complex attribute, a set of
         sub-attributes SHALL be specified in the "value" parameter, which
         replaces any existing values or adds where an attribute did not
         previously exist.  Sub-attributes that are not specified in the
         "value" parameter are left unchanged.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org
For additional commands, e-mail: dev-h...@directory.apache.org

Reply via email to