Closed polybogdan closed 4 weeks ago
It is normal for this issue to occur. You are attempting to replace the 'name' attribute, but the required attributes specified in the HTTP request are not being passed. The required attributes are defined in UserSchema :)
so your advice is to just change the required type of the attributes ?
doing so i lose the value of the property that was not replaced
There are two methods to update the name property.
Update the entire name property and pass the required parameters. If the sub-properties are not present, they will be removed.
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{
"op": "replace",
"value": {
"name": {
"formatted": "formatted",
"middleName": "middleName",
"familyName": "familyName",
"givenName": "Given Updated"
}
}
}
]
}
Use the path
parameter to update a specific property:
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{
"op": "replace",
"path": "name.givenName",
"value": "Given Updated"
}
]
}
Hello,
@simpleidserver the RFC says:
So, if I send this payload:
{ "schemas": [ "urn:ietf:params:scim:api:messages:2.0:PatchOp" ], "Operations": [ { "op": "replace", "value": { "name": { "familyName": "XXXX" } } } ] }
Then it should not override the givenName value as it says in the RFC
Sub-attributes that are not specified in the "value" parameter are left unchanged
No ?
Hello,
Indeed, there is an issue in the current implementation. This issue will be fixed as soon as possible.
Best regards,
SID
After verification, the current implementation appears to be correct.
When the target location (path attribute) is specified and specifies a complex attribute, sub-attributes that are not specified in the value parameter are left unchanged.
Request :
HTTP PATH : http://localhost/Users/$id$
{
"Operations": [ { "op": "replace", "path": "name", "value" : { "formatted" : "newformatted", "familyName": "newfamilyName" } } ]
}
Result
As you can see below, the givenName is not overridden.
HTTP GET : http://localhost/Users/$id$
{
{ "name" : { "formatted": "newFormatted", "familyName": "newfamilyName", "givenName": "givenName" } }
}
the path parameter is not specified, the value contains a list of one or more attributes that are to be replaced.
Request :
HTTP PATH : http://localhost/Users/$id$
{
"Operations": [ { "op": "replace", "value" : { "name": { "formatted" : "newformatted", "familyName": "newfamilyName" } } } ]
}
Result
HTTP GET : http://localhost/Users/$id$
{
{ "name" : { "formatted": "newFormatted", "familyName": "newfamilyName" } }
}
Hello,
Great, understood. I didn't pay attention to this part of the RFC:
Thanks
Hello,
Am am experiencing an issue while patching a user with name details:
{ "schemas": [ "urn:ietf:params:scim:api:messages:2.0:PatchOp" ], "Operations": [ { "op": "replace", "value": { "name": { "givenName": "Given Updated" } } } ] }
Same if both properties of the name "familyName" , "givenName" are passed in 2 different operations