Subject: [scim] Patch replace operation clarification

From: Michael Frost <[email-masked]>
Date: Tue, 20 Jan 2015 15:57:59 -0800 (PST)

Hi, I'm looking for a clarification to patch/replace operation when the target attribute does not exist.   Should the new value be added?  The spec does not explicitly state this behavior (as it does for patch/add).  Similarly, suppose a filter is supplied for patching a multivalue attribute, but no records are matched.  Should the new records simply be added?

My current implementation treats these conditions as a noop and silently moves to the next operation (taking the position that there was nothing to replace).  However, some members of my team feel either the new value should be added or an error returned.  What should be the correct behavior?  Thanks.

-mrf

---

From: Phil Hunt <[email-masked]>
Date: Mon, 26 Jan 2015 08:16:59 -0800

I agree that the PATCH operation is not clear however I am not sure that it will matter from an inter-operability perspective.

I note the API document has a status 400 error of “noTarget” which I would expect would be returned if there was no existing match for the path specified.

There may be some differences in scenarios for replacing when the path specifies a simple attribute, and when the path is a valuePath and depends on a specific value match.

Consider what you would expect to happen in each of the following cases:

path=name.middleName 

vs.  

path=emails[type eq \”work\”]

vs.

path=emails[type eq \”work\”].value

From my perspective, I’m not sure this needs to be strict to be inter-operable.  The actual result could vary depending on the underlying datastore for the service provider.  Of the 3 examples above, I think the third example would have to throw an error if there is no pre-existing emails record whose type is “work”.

Would the group prefer to nail this down more precisely?

Phil

@independentid
www.independentid.com
[email-masked]

> On Jan 20, 2015, at 3:57 PM, Michael Frost <[email-masked]> wrote:
> 
> Hi, I’m looking for a clarification to patch/replace operation when the target attribute does not exist.   Should the new value be added?  The spec does not explicitly state this behavior (as it does for patch/add).  Similarly, suppose a filter is supplied for patching a multivalue attribute, but no records are matched.  Should the new records simply be added?
>  
> _______________________________________________
> scim mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/scim